It really sounds like anxiety more than anything. Have you let him have any period of time to adjust to the new house and everything without being left alone in a cage in a strange place at night? Like a bonding/adjustment period of being part of a family now? Try letting him sleep in your bed and bonding with him for awhile; making him feel like he can trust you and his new environment. He has probably had a rough life and has every reason to feel insecure and afraid to be left alone/abandoned. If you're not able to find a way around the crate at night, at least for awhile, you can try CBD, lavender, giving him a thunder shirt made out of an old shirt of yours that you have worn for a couple days so it has your smell nice and strong throughout the material, etc etc. Anything to reduce his stress and anxiety. Even moving the crate next to your bed can help.
I'm not sure how this was so easily overlooked, either, but it's very possible and often the case that the crate that you have him in is actually bigger than he needs. Crates are not kennels, they're not meant to be much bigger than the dog itself (especially during training) and not meant to be used to keep them in for extended periods of time. If he has room to poo and not be standing or laying in it, (or he is clever enough to back up against the wire and poo OUTSIDE the crate) he has no reason not to.
If you're not already, feed him in the crate. The old saying about not pooping where you eat is pretty literal in the animal world.
If all else fails, you can always bring these kinds of issues up to your vet and see what they think. Best of luck to the both of you, and congratulations on adopting one another! ❤❤
When you let him out late at night, are you making sure he poops then? Consistent rewarding him when he goes outside will eventually make him understand "Outside = treat, inside/crate = no treat". Covering the crate with a blanket at night could help, too, as he won't see where to go/aim.