Original: It was devised due to Einstein being unhappy with classical explanations of electromagnetism which in his view contradicted the principle of relativity.
Simplified: It was devised due to Einstein being unhappy with classical explanations of electromagnetism which he thought contradicted the principle of relativity.