Leaders of democracies are expected to advocate Human Rights and democratic processes, at least by words. This doesn't mean all diplomatic connections need to be broken with autocrats, but at least to refrain from supporting repression or clear infringements of democratic principles. One of the most important of those principles are fair elections.
Because there are huge concerns about the (lack of) political rights of Russian citizens, the POTUS wasn't expected to congratule Vladimir Putin of his re-election. Those concerns include:
Repression of opposing political parties and individual protesters,
Political control of press and medias,
General restrictions on the rights of minorities,
the Russian foreign policy, which is considered as aggressive, in Ukraine, in Syria, with interference in the 2016 US election, with the recent poisoning of Mr Skripal in London, and on other occasions, policies which have already motivated condemnations and sanctions by western powers, including the US,
At least one major opponent (Navalny) forbidden to run for Presidency by a Court decision that seems to be motivated by political purposes,
Unequal access to the media for the candidates,
Lack of independent foreign observers during the elections,
Documented allegations and evidence of frauds during the election itself (whose scale is hard to evaluate) and of pressure on the voters.
All these reasons explain why the March 2018 election is not considered (by many) as a fair democratic election but rather as a communication tool of Putin. As a consequence, most western leaders have acknowledged the proclaimed result without sending any congratulations to Putin.
Note that "congratulating" means not only acceptance but also approval of said election. You don't congratulate anyone for something you consider unfair. By congratulating the Russian president, Trump discredits the voices that raise to complain about the unfair vote, and makes it much more difficult to support Russian activists who are fighting for a real Russian democracy.
Comparing with 2008 and 2012, one should stress that congratulations are much more committing than "well-being wishes" or just a "phone call". By the way, already in 2004, French president Jacques Chirac was strongly criticized for congratulating Putin on his first reelection, for similar reasons (replace Crimea by Chechenya).
Per @patstew, European Commission's president Jean-Claude Juncker was also criticized for sending congratulations to Putin in this (2018) election.
Finally, it seems Trump's congratulations to Putin went against the recommendations of his own staff, which can fuel the debates about his impulsiveness or about how well the White House administration is functioning.