Why do guys say they’ve slept with you when they haven’t?

I was talking to this guy and I learned a couple of weeks after we started talking he had been bragging to his friends saying we had slept together when we hadn’t. At times he even went as far to give fake details. I really liked this guy but that’s gross. Why do guys do that kind of thing