The real issue I have here is that he's not married to me, but even beyond that, he definitely shouldn't marry her. She's stupid, and coarse, and she hasn't even the decency to be pretty.
I know why he does it. First, because he is too honorable for his own good, and also too soft-hearted. That would be reasonable. Men are suckers.
But it's really because it's another reason to hate himself. And Hornblower is always looking for reasons to hate himself. He can be ashamed of himself over the weakness that caused him to marry her. He can be ashamed of himself because she is not good enough to be a captain's wife.
And then! He can hate himself for falling in love with Barbara, who is in all ways superior, just because he has the self-flagellating probity of character that makes him marry poor, unfortunate girls just for the satisfaction of feeling like a dog when a worthwhile woman makes a pass at him.
At least C.S. Forester has the decency to kill Maria off. God knows it wouldn't have been a surprise if he'd left her alive for the remainder of the books just so Hornblower can hate himself with greater virtuosity.