Chris Claremont happened.
Claremont wanted to give Magneto a redemption arc, because Claremont deep down doesn't really like Xavier and prefers Magneto and his way instead.
So Claremont gave Magneto his Holocaust origin to explain away why he's a villain (IE living through the Holocaust made him vow, by any means necessary, to prevent the same from happening to mutants) and make him overtly sympathetic. He then shipped Xavier out into space (originally for good) but when editorial made him bring Xavier back, Claremont planned to have Xavier die in UXM #300 and Magneto becoming the permanent head of the X-Men.
Problem with that was that Jim Lee, Bob Harras, Roy Thomas, and John Byrne all HATED good guy Magneto. So they undermined it and it led to Claremont "killing" Magneto on his way out the franchise.
I should also note, Byrne was so fucking petty over Claremont turning Magneto into a good guy, he threatened to use X-Men the Hidden Years to invalidate the ENTIRE "Magneto was a holocaust victim" origin by claiming Xavier outright MINDRAPED Magneto prior to him being de-aged, with Xavier erasing all of Magneto's memories and replacing them with ones where he was a victim of the Holocaust growing up.