Magneto is a product of his life experiences, his actions are slightly more understandable when you consider the mutant population is extremely compared to the human population. At its height it was still in the low millions I believe. Most of what he does is him acting defensively. Like when you take into consideration most countries were stockpiling sentinels<em>just in case</em>. Its like most countries in the world stockpiling gas chambers and burning crosses.  His mutant powers do cause him lapses of sanity however, so its not entirely a case of him acting out in the interest of mutantkind, but at that point he's literally insane so he can't really hold him accountable for his actions.