Ronald Reagan is the only US president to be elected after getting divorced!
Divorce is an icky subject in politics. In fact, if you want to succeed in US politics, you have to have a pretty clean family life (at least in public), as family scandals are tough to overcome with voters.
While other Presidents had widowed and remarried before Reagan, he was the first one to have divorced his first wife. It is thought that his first marriage had been so long before his election, that it didn't cause a problem with voters.
Other presidents, like Roosevelt and Clinton faced divorce after their wives discovered affairs, but stayed married for the sake of their political career. The only ever bachelor president is James Buchanan. It is widely thought that he was gay.