On Transparency International's corruption scale, Ukraine is less corrupt than Mexico, which is less corrupt than Russia:
https://www.transparency.org/en/cpi/2021
Would the US defend Mexico? Of course, because there are other factors.
First, corruption and democracy are separate things, not contradictory. You can have a corrupt, violent democracy (Mexico) and a clean, rights-respecting dictatorship (Dubai).
Second, there is the question of justice, under international law. Kuwait, a middling corrupt dictatorship, was clearly a victim when Iraq annexed it, and deserving of foreign help. Ukraine is in a similar position.
Third, there is the question of obligation. As a co-signer of the Budapest Memorandum, the US is directly committed to supporting Ukraine, part of its general efforts to promote nuclear non-proliferation. Failure to uphold our commitments would set a terrible precedent.
Fourth, there is national interest. Does the US have an interest in supporting a large Russian-speaking proto-democracy between NATO and Russia? Absolutely. The situation is so perfect that one almost suspects the CIA of creating it as a trap.
But no, "we" are not fighting for democracy in Ukraine--the Ukrainians are. They are paying in blood, we are paying in treasure. By supporting Ukraine, the West *is* supporting democracy: at home, around the world, in Ukraine, and eventually maybe even in Russia.