+1 on respect, consistency, and then more consistency.
Huey used to do this. Going in and out of his stall, he'd drag his butt like he thought the fires of hell were on the other side of the door (outside, if he was in; inside, if he was out, yes, same stall all the time). He'd get persuaded to approach the door, and then he'd barrel charge right through the thing, and who cares if any person was in the way. I am pretty sure that someone had been careless and let a door or gate close on him, possibly repeatedly. But still. I won't let that happen, and he needed to learn this.
This was before he became my horse. He tried that on me once. I had a firm grip on the lead rope pretty close under his head, and as soon as he started to gather himself up to charge through the door, I gave the lead rope a good firm yank and wiggled it in a big way to get him to back up (this is *after* we taught him that wiggling lead rope means "back up"...usually, he doesn't need a big huge wiggle, but it was pretty clear that he had other things on his mind, and the dramatic gesture served to redirect his attention). He backed up, and I told him "ho!" and stopped him in the aisle for a minute, and then we tried again. He did much the same thing, and this time I backed him about twice as far. Then we stopped, and took a breath, and tried it again. He got the clue, and I haven't had any problems with him lurching through the door or gate since.
Best to cut this behavior off right away. The others are right - it's dangerous. AND it's a nuisance.