Designating someone the position of an "ex" is something that happened for a reason, a reason that was strong and reasonable enough at a given point in time. Most probably both people move on, if not emotionally then at least physically, and someday start a relationship with someone else.
Some people befriend their ex-partners after grieving for sometimes before or even after entering the next relationship, some go completely no contact for life with them and rest are on and off, unable to decide if they should befriend them, just stay in touch as common friends of current friends or completely cut off.
There are several good reasons for which one should not befriend their exes. The reasons that I am giving here are opinions of experts combined with my own opinion based on my observation of couples around me all my life in school, college, and current society. So here are the reasons why you should not stay friends with your ex.
You two had a very deep attachment, emotional( and probable physical also) at some point of time in your lives. And such attachments don't just go away like that. The chemistry was always there that bound you two but the lack of compatibility or abuse or any other potential reason like some social issue etc was very much there which caused the separation. If both of you really desired to stay together you wouldn't be exes today.
Coming back together as friends can ignite the flames that got extinguished in that time when you two struggled like anything to stay away from each other. All the pain, sacrifice and labor that was put in to dampen the intensity of emotions at that time may go in vain in a blink of an eye. The pain that was inflicted upon you which caused the separation may once again be felt in this journey of friendship. After the separation, one or both of you might have started a new romantic journey with someone else and this partner will feel really hurt, even if they don't show it to you if they see any subtle emotions in your eyes for your old love. A lover's emotions are as deep as an ocean, you never know how they might overtake you into betraying your current partner if not in obvious ways then at least in subtle form. One needs a hell of a lot of time to heal and move on completely from a breakup if they were seriously committed to their previous relationship. One needs to acknowledge every emotion that comes up and let it pass at its own pace and if someone thinks that they can move on to the next partner and stay friends with an ex then there might be a chance that they either didn't have very strong emotions in the first place or they just suppressed their emotions in an effort to move on quickly to next partner with a plan to stay connected to the ex-partner. In the latter case, the emotions will resurface more easily and quickly.
There are millions of people on this earth including very nice people from your family and friends who are very eager to keep in touch with you and reciprocate with you like great friends and therefore there is no reason I see on this earth why you should stay friends with your ex except for the reason that you never really moved on and want them back, but if such is the case then you need to a lot of brainstorming on the issue which caused the separation in the first place.