The mindwipe of Magneto is a necessary action and it is also a wrong one, but it appears to be the only way to save the human population from extinction.