The program would have benefited 43 million Americans at a cost of $400 billion.
The vote was 6-3, with conservative justices in the majority in an opinion written by Chief Justice John Roberts.
Six GOP-led states had challenged the program as executive power overreach. The administration had argued it was supported by emergency powers Congress had granted under COVID relief legislation.
The program would have canceled $10,000 in student debt for all borrowers who made less than $125,000 and up to $20,000 for borrowers who also received Pell grants.