If you want to measure distance travelled over the earth you want nms since the earth is a sphere and you don’t want your route length to be longer when you’re at higher altitudes
If you’re measuring distance in nms you want knots as they’re nms/hour
We use kms for other things though- like weather minima, runway length - things on (or close to) the surface. Eg I need either 5km or 8km forward visibility to enter some controlled airspace.
Ft for height is less functionally defined though- that’s just the way it is because it’s the way it’s always been. Not much gain in changing it though