Hitler gained power because non-Nazi conservatives such as Hindenburg and Papen[0] installed him in power, because they thought they could control him, and because they viewed him as a lesser evil than the socialists and communists who were also jockeying for Chancellorship, and because they saw appointing Hitler as Chancellor as an end to the gridlock in the Reichstag – the result of the election was that Nazis were the largest party but did not hold a majority, but the next two biggest parties, the socialist SPD and the communist KPD, could not unite against them because the KPD was under instruction from Moscow not to cooperate with the SPD. Leading representatives of industry and finance also pressured Hindenburg to install Hitler, because they saw it as an end to the political chaos and also as a defence against the threat of the socialists and communists, who might harm those economic interests if they gained the Chancellorship.
Although Hitler only had 37% of the popular vote, he also had substantial support from Germany's elites. He gained power because he convinced the people with the power to give it to him. Of course, after the war, many of those same elites tried to pretend that their decision to give Hitler power never happened, or that Hitler had somehow forced them into it.
[0] Papen was not a Nazi at the time Hitler came to power. He naïvely thought he could control Hitler and the Nazis; after a while he learned that not only could he not control them, they could control him, but by then it was too late. And then he became a Nazi himself.