Submissive Peeing Dog? Scared Dog?

My one year old cockapoo is fully house trained but every now and then when someone bends over and touches him (including me) he pees. It is getting annoying since he does it at different times. For example he will jump in our bed on his own and if I touch him sometimes he pees on the covers. Of course I don’t want him in the bed now.
I spanked him one time with newspaper because he was tearing up the pillows on the couch, but it wasn’t hard or anything. it was just two simple taps. Now everytime I come home he runs in the cage and comes out when he wants and then comes to me and jumps on me and asks for kisses. Which I give him. I don’t know what to do, he doesn’t do that to my girlfriend when she comes home only me. He jumps up and gets excitied when he knows she is outside, but I don’t get the same in return. Help please?