The opposing party is traditionally in favor of student debt forgiveness, whereas Trump's party is traditionally opposed to it. If Trump just wanted to help students, he had ample opportunity to do so before now.
The simplest motivation is always self-interest and, for a politician seeking re-election, winning that election.