Almost relationship ended

After we were intimate twice he became distant and eventually we stopped talking. Am I stupid for being heartbroken over this?
I didn't expect for him to treat me the way that he did now I feel like rotten inside I don't know what to do.