You have to realize that The Simpsons is a comedy show and, like The Onion, derives a lot of its societal comedy from extrapolating weird existing situations to extreme ends.
Back in the 1960's, before the courts made it illegal, a lot of shops would refuse to serve patrons of color and anyone else they considered socially undesirable. Top of that "anyone else" list was usually "Hippies", which generally meant men with long hair, women wearing jeans, and everyone generally attired in hippie fashion.
This attitude is documented in the 1971 song Signs, by Five Man Electrical Band:
And the sign said "Long-haired freaky people
Need not apply"
So I tucked my hair up under my hat
And I went in to ask him why
He said "You look like a fine upstanding young man
I think you'll do"
So I took off my hat, I said "Imagine that
Huh! Me workin' for you!"
It would of course be both appalling and a violation of the common medical oaths for a professional to refuse emergency treatment to someone because of their social position. That doesn't mean it didn't happen (it certainly did with people of color). But the joke here is that an ambulance service was doing it with "hippies" too.