He could have, but it would not have been good for him.
In these days, divorce was possible, but it was difficult. If his wife could prove he had been having an affair, she could have divorced him. For him to divorce her, he would have had to find some kind of grounds for it (there was none of the "no-fault" divorce that we have now).
But if FDR had gotten divorced, I would say that his political career would have been pretty much dead. People in those days were much less forgiving of things like that and they would have thought that his (presumably) bad character would have made him a poor choice for office.
President Franklin D. Roosevelt, the creator of the New Deal, would have been ruined politically if his wife Eleanor had sued for divorce because of his love affair with Lucy Mercer. One of the causes for which Adlai Stevenson was not elected president in 1952 (and 1956) was that he had been divorced. It was not until 1980 that a divorced person was elected President of the United States. So, in 1904, divorce was unusual. People mostly were consigned to the private unhappiness of bad marriages in preference to public divorce.