This makes complete sense. If we didn't sympathise with the protagonist (no matter how flawed they may be), that character wouldn't be able to fill that role in the story. When the villain is particularly nasty-- their agenda includes, say, bringing about the end of the world, wiping out dissenters, and banning delicious pastries*-- it can be extremely difficult to see how anyone would willingly sign up to join them. At the same time, when the protagonist's point of view seems obviously right, we assume any sensible person would agree, and that someone who defects from the Dark Lord must have simply seen the facts and had a complete change of hard.
Real life, of course, is more complicated. Although history occasionally drops some Obvious Good Guys vs Obvious Bad Guys conflicts into our laps, it's the exception rather than the rule. And even those reasonably clear 'good vs evil' showdowns can include questionable tactics in the name of admirable causes. When the moral lines are blurrier, people often choose the side that benefits them or their pet causes, whether or not they have any strong feelings about the bigger conflict at hand.
The other thing to remember is that genuinely changing sides is a difficult proposition. An opportunist who joins the hero or the villain simply because it's the best choice for them is very different from someone who makes an actual ideological shift. Changing one's belief system means changing a part of one's self-identity and reworking the way one sees the world. It's a big undertaking, and for an adult character will require some external trigger. The larger that shift, the more significant the event or realisation that has to precede it.
In writing someone who changes sides-- whether they're joining the protagonists or antagonists-- it's best to focus on their personal motives. Maybe it's fear. Maybe it's the discovery of game-changing facts. Maybe it is simply grabbing a material opportunity. Or maybe it is a combination of all of these. Whatever drives your character, it should make sense, and perhaps add more depth to the conflict driving the story.
*For everyone who's not a European history nerd-- this person existed.