https://en.wikipedia.org/wiki/Sovereign_immunity_in_the_Unit...
Sovereign Immunity is an idea that has a long precedence.
The Supreme Court was arguing that bad behaviour by the President is resolved through impeachment, and once they are out of office they are subject to criminal charges.