Enterprise Java was almost entirely an IBM creation. IBM had a whole bunch of code that had no real path to money (San Francisco framework with roots back to Taligent). Sun was headed into a firefight with MS; they knew it and knew that they didn't have the resources to go it alone: Sun needed a Gorilla partner.
And so a deal was struck and the world was lumbered with the dumpster-fire that was J2EE, against which Spring Framework was a logical (maybe even sensible at the time) reaction but which ended up becoming it's very own brand of behemothic monster.