 The reasoning was that if a president's subject to prosecution for his constitutional acts, he won't be able to exercise those powers completely and with confidence that they won't result in a prosecution after the fact. So the court said for constitutional acts, the president's completely immune. For official acts, he's at least presumptively immune and the government would have to overcome that presumption. And so it's based on nothing explicitly in the text of the Constitution.