I wonder how much of this is driven by a lack of vision, and simple inertia. I've used Rails as my main tool for 10-11 years, since the 2.x days. In the company I work for now, the one app I had written has been mothballed, and I was told I could no longer use it.* My choices were either .NET or Java, and that's simply because we had been an "IBM/Oracle shop" for 25 years, until we became a "Microsoft shop" since transitioning to O365. Because what I'm integrating with is all Java, I chose Java, but these days, to even try to compete against modern stacks, that implies Spring, and either Angular or React.
My theory is that old, manufacturing-based companies are just locked into a mindset of "this is what we do," and that comes from an answer from 20-30 years ago. They don't care to optimize for IT tools, because it's not their expertise, and they're throwing money down the drain because the C-levels just play the game of hiring consultants to implement whatever Microsoft pays to put in the trade magazines. So we get H1-B's with, and outsource for, that skillset. And then the consulting industry educates and trains for this skillset, and it becomes a self-perpetuating legacy situation, a little like Cobol and mainframes. We just can't get away from it, because it's too hard to switch everything to something else.
* The person responsible for the decision told me, "You're the only person in the company who knows it." I asked, "Rails is the most productive thing I've seen in 15 years; why wouldn't we hire for that?" I didn't get a response.
I've come to the conclusion that I hate using Java for web apps.