Uh why? Seems like you could easily argue that the war with Mexico and opposition to the Wilmot Proviso provided some essential fodder for the Civil War, which I would say hurts his rating.
I wrote a paper on Polk in my AP American History class in high school. And I remembered exactly zero facts about him other than the fact that he annexed more territory than any other president.
Interestingly, he still comes away with a loss if you ignore that. He lost the Palmyra Atoll to Hawaii, but managed to annex the Swan Islands, though they weren't big enough to compensate.
You forgot the US Virgin Islands, and are you counting the land they stole from the Native Americans? Strange how nobody ever really talks about Polk or McKinley even though they got that much land..
Basically all American land was stolen from indigenous peoples. Also nobody talks about McKinley because 95% of the land he gained was the Philippines, a move which seemed pretty imperialistic and heaven forbid the US seem like an empire!
The states that seceded during his administration hadn't been entirely recaptured by the time of his death.