You leave yourself vulnerable to be exploited
By staying friends with an ex and getting yourself worked up with the hope of a comeback, you actually do leave yourself vulnerable to treating them like a boyfriend or girlfriend, and not just a friend that they are now.
You might find yourself doing for them things you would normally reserve exclusively for someone you are dating.
This is to be expected especially with partners who had sexual connections prior to their breakup.
For many, they engage in every imaginable foreplay and manage to catch themselves just before the actual act of penetration, but many aren’t so cautious.
As a matter of fact, whether or not you are able to stop yourself before the actual act of sex, making out and smooching will only complicate things, and really, you would not be tempted to smooch and carress that your ‘ex-boyfriend’ if you both had stayed very, very far away from each other.