A massive wall protects the native village from King Kong. But if you build a wall to keep a giant ape out, why would you put a door in that's conveniently his size?
I have only seen the 1933 and 2005 versions, neither of which address the origin or purpose of the door.
The only explanation that I have read about this is that the human inhabitants of Skull Island chose a defendable peninsula, and built the wall to make themselves an enclave. The map from the 1933 picture is below, showing the peninsula as 'village' - a significant portion of the island so likely to have been infested by dangerous creatures whilst the wall was being built.
Being able to herd dinosaur sounds implausible, but no more implausible than being able to build the wall in that environment in the first place. Maybe they used fire to scare the creatures off and herd them.
The gap in the wall and the door was built to allow the final dangerous creatures such as dinosaurs to leave the enclave when the wall was complete, and then humans closed the door.
If I was an islander however, once the door had been slammed shut, I would be bricking it up as well though!