The president’s close Republican ally threatens fines, penalties or even prison for officials failing to secure their elections.