We start things off with him buying the damned thing in the first place and deciding that he cannot risk ridicule by the guys by buying a mushy Valentine that would get him teased and also, gushy stuff isn't him so clearly, Martha will love what he buys her because it's him. What is clearly happening is that, as always, he refuses to let common sense or what other people might actually expect of him or actually like get in the way of making a decision.
Since he's got a rancid baked potato for a brain, Martha's inevitable angry reaction to his mind-blowingly stupid and insulting card is not taken well. Rather than admit that he has to do something to make up for brainlessly hurting her feelings and making her feel small, the idiot smacks himself on the head with a basketball so he can focus and makes everything her fault because she is clearly trying to dominate and confuse and trap him by making him admit that he has to think about other peoples' feelings and not just do whatever he pleases. It's sort of like how it never penetrated his thick skull that no, Elly isn't a robot plopped on the Earth's surface to clean up after him because he's programmed for oblivious, entitled selfishness and screaming about victimization when asked to give as well as to take. Eventually, she decides that she can do better than this stupid manchild and is punished for not wanting to immolate herself on the pyre of his pea-brained ego by living the horrible life Phil wanted Connie to have because he's a stupid piece of shit who can't take rejection either.