My understanding, from reading some of the history, is that in the early 1980s when Lamport wrote the set of TeX macros that became LaTeX, already TeX had spread like wildfire among math/CS departments, and it so happened that TeX itself was a more widely available and reliable (see "trip test") programming "language"/platform than any actual programming language. (This was when C was yet to become available outside of a handful of labs and universities, and what most people had was a variety of mediocre Pascal compilers that supported differing sets of Pascal and extensions, which is why Knuth wrote TeX in a very tiny subset of Pascal extended with his own preprocessing system (WEB/tangle/weave) — and still it is said that compiling and testing TeX uncovered at least one bug in every Pascal compiler encountered.)
So at that time, it made sense to "do everything in TeX", and LaTeX's approach of hiding a lot of insane macro-hell complexity behind innocent-looking boxes, an approach since taken up by zillions of "packages" of varying quality, leads us to the situation we're in today.
But there's hope: with LuaTeX inside the TeX world, and things like markdown/pandoc outside of it, people are slowly beginning to get used to doing the programming part in an actual programming language (Lua or whatever), and using TeX merely for typesetting, in which area it is still good / a reasonable and not-too-weird piece of software.
This has allowed both to grow in functionality, year after year. Code written by users wanting particular capabilities has led to so many fantastic enhancements. No one user or committee could anticipate the many ways that these programs could be extended. Although, it would be nice if these systems could be cleaned up and modernized, this is only a dream. In practice, nobody has the time to start over on these enormous bodies of work comprising millions of lines of code.
It's too bad, because it's a joy to use ether of these system once you've spent enough time reading their extensive documentation and puttered around with them for a few years, but their eccentricities and anachronisms keep them out of the hands of many users.