Wow peaches!!
Noticing that about yourself is fantastic!
I do the same thing myself, making myself miserable. The cause, for me, is self-hate. It took a surprisingly long time for me to figure this out too! I now understand that I blame myself for growing up in an unhealthy dysfunctional family. So, the shame and self-hate is deeply ingrained in my psyche. It's not an overnight fix.
I have to somehow learn to accept myself and my past before any real changes occur in my life. That's not to say I won't allow happy moments. I do allow that occasionally. The time, however, is brief and I don't allow myself to completely let go.