Why doesn't every bank account come with a "deposit only" number? I.e. why do I have to give my account number (and thereby give the ability to withdraw money from my account) to someone whenever I want him or her to send me money? It seems like a deposit only number would add a lot of security and confidence, so there's probably a good reason it hasn't been adopted.
There is no need for that if you have a system with proper authorization, and if you don't have a system with proper authorization, it doesn't help you at all.
First part: in Europe, account numbers are public, nobody cares. All you can do is deposit money. If you want to take money out, or transfer it, you need a proper ID, or an online access password. [only in the US can you go in a bank and say you don't have an ID but you know your ('someones') SSN and address and you'll get money].
Second part: without proper ID enforcement, people would just randomly try 'withdrawal' numbers until they find one that works.
Conclusion: keeping your account number 'secret' is a silly solution to protecting your money in the bank.
EDIT: undeleted answer.
why do I have to give my account number (and thereby give the ability to withdraw money from my account) to someone whenever I want him or her to send me money?
You don't. Money transfer methods (PayPal, Zelle, etc) which don't require you to give your routing and account numbers to everyone you want money from do exist, and they in effect use asymmetric deposit numbers.