Is it because they actually don't?
My exh was like this. He was perfectly pleasant to the neighbours and the postman but he was grumpy and miserable with me and his family for that matter. In the end I didn't like him very much either.
I can't work out why you would choose someone as a partner and just not be pleasant and kind to them. I see so many threads on here where the op is being treated badly by their partner and a pp points out that their partner doesn't even like them.
Btw my ex left and after a year decided I wasn't that bad after all, declared undying love and wanted to move back in.
I can't really get my head round it.