Not enough information, including where in the world this is.
Usually a deposit is both to ensure you follow through on a transaction, and to cover any damages that might occur during a tenancy. The only way you get a deposit back is if you uphold your end of everything, and follow through on the lease as well as cause no damages that justify retaining the deposit.
When you put down a deposit on a lease, the landlord stops showing it to people, etc. If you don't move in, you forfeit it. The landlord could have rented to someone else otherwise.
You'd only have a good argument to get it back if the landlord is able to rent to someone else right away and doesn't actually lose out on any rent.
Anyway, no, deposits are not required to be returned if you never move in. The whole point of a deposit before you move in is that the landlord gets to keep it if you don't follow though. So it's the contrary.
Don't put down deposits on things unless you're ready to forfeit the deposit if you don't follow through. And that also goes for custom-made clothing, etc.