If the crate is used this way, as a jail for time-outs, of course the dog will see this as punishment, and the crate as a place to avoid.
You want the dog to consider the crate as his secure place of refuge – the safe place he goes to when he wants to rest, or take a nap, or sleep at night, or just be by himself.
When he misbehaves, you should scold him and send him out of the room – you want him to go to his crate on his own, as his safe place to retreat to and ‘lick his wounds’. That means you never scold him when he’s in his crate. If it’s in the same room and he goes into his crate wile you’re scolding him, you have to stop scolding. (But this is fine – it means he has learned 2 important lessons: 1) I did something wrong, and annoyed my pack leader, and 2) My crate is my safe space to hide out for a while.)
P.S. Why Yelling at barking dogs doesn’t work.
In a dog pack, a dog barks when it sees possible danger (or prey); a nearby dog reinforces this by taking up the barking too, and soon the whole pack is alerted.
When your dog is excited by something, like the mailman walking toward your door, he barks to alert you. And you reinforce this by making loud yelling noises, too. Obviously he has done the right thing by alerting his pack to the dangerous mailman.
Yet somehow the pack leader now seems to be angry at me, for sounding the alarm that he reinforced by also yelling loudly? Something here is very confusing to my poor doggy mind!
Can you see why this is an unclear signal to a dog?
My mother, in her 80’s, had a house dog that would start barking as soon as anyone drove into our farmyard (actually, as soon as they started slowing down on the highway to turn into our quarter-mile driveway). When she did, my mother would just say, in a quiet, calm voice: “OK Jeannie, I know someone is coming. Good girl!”. And the dog would then stop barking, and go wait by the door.