He lost popularity because of voter fraud in big cities.
I have little doubt Democratic voter fraud happens in every election. Romney lost by 5m votes and McCain lost by 10m votes, compared to Trump's 3m. I'd suspect voter fraud was probably about the same as it's been in every other election. When comparing 2012 vs 1996, two problems stand out.
One is that Asians (1% of the vote in 1996 and 3% in 2012) are voting increasingly Democratic, from 48(R)-44(D) in 1996 to 73(R)-26(D) in 2012. That means the GOP suffered a net loss of roughly 1.5m Asian votes from 1996 to 2012.
Another is that Hispanics, while increasingly Republican, still favor Democrats and are expanding rapidly as a share of voters, going from 5% of the vote in 1996 to 11% in 2016, while going from 73(D)-21(R) to 65(D)-29(R). Thanks to an increase in population %, the ideological drift is more than offset. In other words, in 2016, the GOP had a additional gap of 4m Hispanic votes to make up vs 1996 just because of immigration.
The white vote is increasingly Republican, but not to the point that it can make up the losses from immigration. This is why the logical thing for the GOP to do is to radically slow down both legal and illegal immigration. If they fail to do so, we could have many decades of Democratic dominance ahead. Amnesty of any kind would be poison for GOP prospects, given the guarantee of chain migration that follows citizenship.