Pretty normal to have passport check on exiting a country. You might have overstayed your visa and you are going to be fined or banned, or you might be a criminal and they will arrest you.
Problem is that nationals are usually not extradited for crimes done in other countries, even if it happens in shengen area. So each country better check who is leaving to get criminals / fines not paid / avoid child leaving with one divorced parent.
I guarantee you that if you fly from NYC to Miami, you will not be asked for your passport after TSA checks. You can freely travel between the states.
I think that you may be European. Here we have freedom of movement, and used to laugh at the USSR where people needed papers for internal travel. Sad to see it returning, and the Shengen idea now being dead for practical purposes.