sodium have a higher ionization energy compared to pottassium because of two reasons:
1) The Potassium lone electron is farther away from the nucleus than the Sodium lone electron. So there is less nuclear force to hold the Potassium electron, hence it can be ionized easier.
2) The Potassium electron is in the fourth orbital, so there are three orbitals between it and the nucleus. There are only two electron orbitals between the Sodium electron and its nucleus. So there is less of an electron shielding effect in Sodium, allowing the nucleus to exert a larger net force.