The referee's decision is final.
That is the sentence that ensures we have this sport.
Once you change that, it's finished. Even with VAR - as corrosive as that is - it is still a team of referees advising the referee who then takes their recommendation or not. The ref's decision is final. When he allowed that match to restart, he then had to see it through. He did and, to the horror no doubt of himself and the kleptocrats who run African football, Morocco missed their penalty and Senegal took full advantage.
Once you start overturning matches, it's over. This is beyond even ordering a re-match, which is draconian in its own right.
Senegal - and Morocco - know who won that night. It might not have been pretty, but both teams played on after the temporary chaos. Natural justice dictates Senegal won.