Painting Czolgosz as simply a mentally disturbed bad man misses the point and the larger issues of the era in which he lived. It didn't take an immigrant with a 'history of mental problems' to realize the US government was the 'enemy of the working man' in the Robber Baron
era of the late 19th century.
In the year before Czolgosz shot McKinley, federal troops were called out to massacre striking miners in Utah. Czolgosz himself cut his teeth working in a bottle factory under the horrible conditions that prevailed at the time - conditions of course that were due to government inaction, because government had become, like today, merely the legal enforcement arm of corporations. He regularly witnessed his co-workers, many of whom were mere teenagers, burned and disfigured by the machinery they worked with for twelve hours a day. Regardless of his mental state, Czolgosz had some pretty legitimate concerns about what the US government was doing.
There is an interesting post-script to this story: Czolgosz grew up on a farm in northern Ohio that was a mere 25 miles from the town of Niles where McKinley was born.