Why did I do that

So yesterday my ex/soon to be baby daddy came by to check on me to see how I was doing. We broke up after I found out I was pregnant and he got with the person he cheated on me with! Anyways we we were togther for 7 years so it was truly devastating to me and it affected me badly in the first trimester. I had to get back to my life without him and change of routine it was hard! I hated him for it and I always said I wouldn't put my self back there well it's been 7 months since the break up and he been friendly he takes me to doctors appointments and help with baby stuff. So yesterday he came over and we were talking about the baby and everything then he became flirty and everything and I was like why he's doing this at first but then I just kept smiling it off. He kept saying that's his and rubbing my belly and that he still cares about me whatever. So he was about to leave and he asked for a hug but I gave him a hi-five and a little huh but really like distanced hug. He started saying omg you don't even want me to touch you. I know we have chemistry still and I didn't expect to feel the way in the moment but he started to kiss me and I kissed back and then he lifted me into the bedroom and we started having sex I was in the moment and now he messages and calls everyday I'm not sure what's up but I know I'm not going to get back with him but I can't believe he was ok with cheating on the other girl! Well I mean he cheated on me with her so obviously but I didn't even feel bad for her it's like this is exactly what she did to me knowingly. I do feel terrible about me letting him in again but for some reason I just want her to feel the way I did. I'm not a bad person but I guess the heart makes you do stupid things