In my opinion, the reason it works well for PTSD, is because it temporarily suppresses feelings of fear, shame and embarrassment. It also makes you more trusting of other people, which can be good in a therapeutic setting, as it might make it easier to open up. On MDMA, you can look at your own past without any judgment. That makes it easier to look at things in a way that's more detached, and begin to process what actually happened without being flooded by negative thoughts.
I'm uncertain if that would impact ego directly though I imagine it perhaps could through helping heal/process/remove past trauma and its associated emotion and stress, which then potentially will allow ego mind guard/coping mechanisms to dissipate.