It is not illegal to pay someone to keep quiet about an activity that was not illegal but may merely be personally damaging to one’s reputation.
It was legal. Dems just want to keep it in the news and allow the media to cast doubt on it with their corrupt fake reports.