This does not specifically relate to 9/11. The US, like the EU, uses a "first point of entry" set-up for immigration. That means that when you re-enter US territory (in this case the USVI) after being on foreign soil (St. Maartin), everyone on the ship MUST clear customs. Now, there are two ways to do this. You either do it while still on the ship, and customs still has some control over all the people, or you require all the people to file through a customs terminal, similar to what happens at the airport.
If you have ever flown outside the country and had to catch a connecting flight, you also had to go through customs the minute you landed on US soil, even though that wasn't your final destination. Same principle applied to the ship at St. Thomas.