Regarding your programming analogy, I think of it slightly differently -- scales : playing :: touch-typing : programming. Sure, you don't need it but it will make you a more efficient coder if you don't always have to look at the keys.
Another view is that learning scales is a way of compiling a whole lot of low-level muscle knowledge so you can think and play at a higher level of abstraction. You don't always think about programming in terms of Turing machines because languages hide that level of detail.
I agree with your last point though: you do need immersion and an "ear" to play well. However, practising technique and learning theory are not mutually exclusive. For example, learning a language is easier if you study some grammar as it gives you useful concepts for processing the spoken language you hear while immersed.