In practice, as the power of the federal government has grown almost exponentially since 1789 and the power of the presidency has grown with it, presidents have claimed immunity from the need to comply with the law while in office. They have also claimed immunity from the consequences of the failure to comply with the law.
That immunity claim is predicated upon the belief that if the president committed a criminal offense and was charged and prosecuted while in office, the diversion of his energies to his defense would interfere substantially with his ability to do his job, which could jeopardize national security.