The physician once was expected to wear a white coat. Something, since those days, has changed. I am not sure why or how this change occurred but it did. The coat and tie disappeared somewhere along the way.
The white coat I guess was to imply that the physician was clean and did not spread disease. In the attempt to prevent infections from being spread by physicians or hospital workers the white gowns masks and booties were required as appropriate for the operating room. Underneath these white gowns, green scrubs were developed so that all outside clothing was kept out of the operating room. The nurses traditionally wore white uniforms but with the need for functionality these were gradually supplanted by clothing that permitted rapid action and easier mobility. Hospitals in attempting to simplify dress codes brought the green scrubs into existence. Once started these green scrubs developed quickly into standard garb for all hospital workers.
(Although most are green they also come in red and blue).
The scrubs priced favorably between 5 and 20 dollars soon found favor with healthcare workers and proliferated. The scrubs became ubiquitous. Seen not only in hospitals they soon began to appear in many other places. Some of the medical personnel seen on the television screen even appeared as guests on some shows in their tailored scrubs. (Either they were tailored or they fit them much better than most of the scrubs I have encountered).
I suppose this desire to display a uniform that displays his or her occupation has always been around and many craftsmen felt it was representative of what they do and constituted a subtle form of advertising. The butcher wore a blood stained apron and the mechanic his grease stained overalls as well as many others. Doctors are really no different.