Because he was the villain who was supposed to lose, and Roxanne was his origin story. In universe, it's because he's an autistic, entitled, rude, self-pitying, incompetent, mean loser(and coincidentally ugly). And despite the overarching theme of the movie, we never see what made him this way, or even an attempt to change.
Nobody disagrees that Hal is a villain(hell, he would probably be deeply hated by total strangers before he got powers), so explaining why is pointless. But I think it's worth it to say that his lazy character is a stain on an otherwise great movie, as what makes him good at being a villain also made him a bad villain for the movie. His inclusion contradicted the message of the movie, allowed the writers to sweep Metro Man's questionable actions under the rug, and was frankly just too predictable to even be a novelty.
If the movie past Roxanne running away after Megamind's disguise was broken was instead about him trying to better himself by having Metro Man as a mentor, which leads them both to discover Metro Man is actually kind of fucked up, and then finding some satisfying ending from there, I think this movie would have been undeniably amazing. I have no clue what could have led to Hal's writing being so awful other than perhaps some studio exec deciding the moral was too complex for kids so we'd better dumb the rest of it down.