It’s as simple as dogs love to sniff, and the air going by is chock-full of mysterious scents.
BTW, animals have no concept of spaying/neutering. If they’ve had a bad experience from an animal clinic, something happened while they were awake, or they felt abandoned by the owner and are afraid of a repeat when they smell the clinic smells.
When our dogs get to stick their noses out the car window, I think that they’re imagining that they’re flying ........................................... FRegards