It was intentional that you can run and be elected as president from prison. It’s written about contemporaneously. They knew the risk of allowing a president, or administration, jailing their political opponents.
What’s not clear is if it was meant for a president to be able to pardon themselves. I personally would think not, but many think it’s permissable.