I am a cyclist who is sympathetic to veganism and eats less meat than your average omnivore. The main reason I still eat meat is that I am not convinced that most plant based diets are not missing something important. Never faced much hostility for choosing to eat plants, but can't say the same for cycling.
Thinking about it, I have never once met a preachy cyclist but have met quite a few preachy vegans. Level of preachiness does not seem to explain the stronger stigma cyclists have.
It's probably similar for cyclists. With global climate change and the general lack of physical activity in modern societies, the mere existence of cyclist is treated like some kind of personal attack. "You're not as conscientious or healthy as I am", as it were.
Though, like preachy vegans, there are also some cyclists who agitate everyone by completely ignoring both courtesy and the law when sharing the road.
Motorists I would argue are much, much worse at obeying traffic laws than cyclists (perhaps simply because there are so many more of them). I think this is made much worse by distracting electronics in a the vehicle.
Regardless, why should a few bad cyclists be the measure for an entire group of people simply making a personal choice on how they're going to get around? Drives me crazy.
As far as I'm an tell about the same fraction of drivers and cyclists break the law. They, however, tend to break different laws: rolling through stop signs is more common for cyclists, whereas speeding is more common for drivers. Often when I point this out a driver decides to defend speeding, which I think is the wrong response. If the problem they claim to have is respect for the rules of the road, then justifying speeding is hypocritical. (For what it's worth I follow the law to the letter.)
Plus, as you've said, the actions of a few bad people in a group should not strongly color perceptions of the entire group.