Regarding dentists, not medical doctors: It's not illegal, it's just outdated.
You will find a lot of sources online that mention an American Academy of Pediatric Dentistry recommendation that children perform better when their parents do not accompany them. Something something maternal anxiety. But this is likely the result of 40-year-old research. Some of this was built on studies of how the dentist performs rather than how the patient performs, which is how you get journal articles with titles like Physiological responses of dentists to the presence of a parent in the operatory.
The tide started shifting more than 20 years ago.
Getting outside of the law here, I found this document which demonstrates the lengths to which the AAPD is going to inform its members of the benefits of parental involvement. http://www.aapd.org/media/policies_guidelines/g_behavguide.pdf Just take a read through the bibliography to get a feel for what your child's dentist should have been reading.