Although Lily often gets the loudest hate, and Barney's character has aged terribly, when people were given a choice, 27% of them picked Marshall as the worst of the main five. He's definitely done some questionable things, such as invite Lily's estranged dad to Thanksgiving without telling her. In a Reddit thread, users wrote that he crossed this line because he couldn't understand poor parent-child relationships like those that Lily and Barney had with their dads. User u/Ndmndh1016 pointed out that "Marshall always has difficulty accepting that not everyone shares his views on the world." Then there was that time he slut-shamed Robin.
Still, Marshall is a surprising choice. A look at the "How I Met Your Mother" fandom wiki will show several paragraphs about Lily's selfishness, manipulation, and penchant for punishment. Compare that to Marshall's personality description, which focuses on his "inherent kindness," passion, and confidence. Yet in the poll, Lily got just 13% of the vote, with Robin the only character to get fewer votes. Barney got the second-highest amount of votes for the worst character, with Ted firmly in the middle.