I think Rick takes hating everyone because if the goverment or aliens or his enemies knew he loves his family they'd use it against him.I feel like this was proven in S03E1.
Not just that alone though.
The people who can hurt you the most deeply and personally are the ones you let in to your heart. If a stranger insults you, who cares? You move on. If the person you love and respect insults you bitterly, it has weight, it’s grounded in reality, it stabs you in the heart. Rick has seen people die, Rick loved someone enough to marry them, and then ended up divorced and bitter about love being a fleeting emotion. He doesn’t want to believe love is good, or worthwhile because he doesn’t know how to make it last.