They wear uniforms for exactly the same reasons that police, fire, ambulance and other careers where it’s important to be able to identify a worker. Patients and significant others feel some reassurance when the patient is attended to by a “professional” health care practitioner.
Not all nurses wear uniform laundering services as when I worked in a drug and alcohol rehabilitation service I wore civilian clothing and it was the same when I worked in a mental health facility. Wearing a uniform in that type of environment can create a barrier to establishing a therapeutic relationship.
In the environment where nurses wear uniforms it’s also a good reminder to those clinicians that the clothing they wore to work ought to be laundered and the nurse have a shower before they interact closely with their home environment and families to reduce the risks of bacterium and other nasty’s being brought home from work.