The bar exam tests what you learn in law school. However, that is only the bare minimum for what you actually need to know to practice law.
Law school is for learning how to do good legal research, analysis, and writing, with some exposure to a selection of substantive areas of law thrown in for good measure. At the top schools, there's also a strong focus on understanding the law through historical, philosophical, and policy-oriented contexts. Memorizing "black letter law" is not an objective. In fact, at most final exams, you can bring in a stack of study guides and reference books to look up what you don't know.
People who then go to build software systems are at least hopefully applying at least some engineering principles. Software arguably often doesn't follow as well-established engineering principles as some other types of engineering. But arguing there's some great separation between computer science and engineering really is pedantic.
And universities, at least the more elite ones, always tend toward the theoretical side in all fields. Which is mostly a good thing so long as it doesn't over-rotate. Whatever language you learn is probably going to be yesterday's news in 10 years. (Unless it's COBOL :-))
[And I say this as an engineer with degrees in non-SW fields.]
That was definitely true in the 90s, but I don't think it's been the case for years now. Most schools have degrees like Information Systems where most of the people end up who are just generally interested in computers and/or find CS too difficult. Hell I work with a guy right now whose degree (from a state university) is in "computing" whatever that means.