Rashi explains that Korach was a clever person, so how could he go so far wrong as to challenge Moshe and the whole authenticity of the Torah?
There are many reasons, but it is clear that ego is one of them. Korach in his position,with his power and wealth could have been an incredible asset to the Jewish people which was especially needed at that time (after the sin of believing the spies’ reports).
However it seems that Korach wanted his name in The Book as it were.
Well, HaShem does everything mida keneged mida and so when Korach tried to prove that Moshe was illogical when it came to his teachings, HaShem opened up the ground, an illogical occurence.
And by opposing Moshe’s Diving right to lead the Jewish people, it in fact ended up giving strength to Moshe and to the authenticity of the Torah and its teachings.