What’s the point of having a locked door if the players can just destroy it?

A locked door may be picked and the lock may be broken after a few attempts, but what stops the players to just destroy it? Especially wooden doors, but even iron ones or wooden chests, they all have AC and HP according to the rules.

4-5 guys with a crowbar will eventually open any door/chest that’s not magically locked. Or should the DM not allow multiple attempts to destroy an object?

I’ve always read about how DMs should not ask players to roll when there are no consequences to the roll. And there is no consequence unless the door can somehow remain blocked after a few failed attempts.