Also, at ten months he is an adolescent. Much the same as a human teenager, commands that you thought he had learned will often go out the window, he won't `listen as much' as you've already noticed, and now is the time when he will start testing his boundaries as all teenagers will do. It sounds funny but that's absolutely what is going on.
In terms of hitting, well, you already know that's not effective. If your boyfriend is spanking him well after he finds the trash has been gone through it's even less effective. Don't think that pointing at the trash and then spanking will make your dog understand - it won't. They don't and can't make connections like that.
If you catch him in the trash, red-handed, so to speak, say a firm, deep `Aah!' and then redirect him to something he IS allowed to play with, praising him when he shows interest. Dogs will do what works for them, and will stop doing what doesn't work for them. If you base everything you do with him on that simple principle you'll do just fine.
While he's an adolescent puppy, following this method and keeping the trash out of his reach will do the trick. That method applies to anything you catch him chewing on that he's not allowed. Redirect, redirect, and praise for the right behaviour.
Do not EVER use his crate as a punishment. Like others have said, if you do that (especially if you also use it as a safe haven) it will totally confuse him and make him very fearful and wary of it. You can use time out if he's going a little bit crazy, some isolation for no more than a minute often lets them chill out and settle down. You can certainly leave him in the crate when you are not home, until he learns better what he can and cannot chew and play with, but definitely not if you're using it for punishment. He will think he's done something wrong and will spend his time in there in a state of anxiety that could lead to plenty of other problems down the track.
Now is the time when you need to be reinforcing all of his commands and his behaviours, and putting NILIF into place - Nothing In Life Is Free. He sits for a treat. He sits for a pat or cuddle. He sits to play. He sits for his dinner. It will teach him that he has to earn the good things in life (don't overdo it by making him jump through hoops - a simple sit is enough), and it also teaches him discipline, how to wait for things he wants, how to ask nicely (a sit is the equivalent of a `please') and how to automatically obey you when you give him a command.
Also, be patient. Lots of love and cuddles and praise for doing the right thing. He's still a puppy but a teenaged one, and teenagers need validation, within clear delineated boundaries. Keep us posted.