The XXII Amendment applied only to limit a person from holding more than two terms as President, not to any other office. I am unaware of any law ever passed that would bar a President from seeking and holding lesser office.
By the way, Taft served on the Supreme Court after being President. That rounds out the group of Presidents serving in offices after their terms in the White House. Just because it has been a while since anyone has done it, doesn't make it illegal. Although, Bill Clinton is reported to consider Hillary's old Senate seat every now and then.
SCOTUS is an appointed position, not an elected one. The federal law specifically enjoins someone from running for another elected position, but does not address appointed positions.