My thoughts are it isn't the horse that's the problem, it's the rider. When you're practicing at home, you're more relaxed and not really worried about a judge and what gait they're going to call next and if the judge is looking at you, etc. You're most likely more focused on making your horse work properly.
In a show ring, my guess is you're trying to get your horse looking correct, yourself good, keeping an eye on the judge, watching the horses close to you for steering purposes, etc. So in general, you're less focused and more tense. Your horse can feel even the slightest change in your position, so if you tense up nervously they're gonna feel it. With a lot of horses, they'll be distracted too.
I suggest that when you get into a show ring, kind of forget about the judge and the fact that you are showing. Ride your horse like you do when you're practicing. If he/she acts up or isn't listening, FIX IT. Because if they learn that 'oh when i get in the show ring i can do whatever i feel like because the person on my back won't do crap in here' your horse is learning the wrong thing and it'll only get worse. If you need to throw away a class to get your horse to do its job, do it. I've had to do it a couple of times with my horse. I was trying to do that western riding pattern (the second one since I started one-handed on him) and he was just all of the place, wouldn't get his leads and finally I got pissed. I went two handed, forced his head down, made him pick up his leads and back up, and then all was good. I got DQed I'm sure but even the judge said to me 'sometimes you gotta just throw one away' and he was laughing. I definately agree with him.
So anyway. Ride in the show ring like you ride practicing. Don't forget about the judge all together, but try not to worry too much about them either. All it is (at small open shows, which I'm assuming you're talking about) is a $5 opinion. :)