So it still has little specifically to do with Java vs. node.js. Just a ridiculously bad old process to a better new process.
There is nothing about Java that stops you writing your CSS in CSS and your JavaScript in JavaScript. In fact, that's the standard way to do it. It seems that at PayPal, something went wrong early on that led them to build some byzantine homebrew web framework as a rod for their own backs. I have no idea why anyone would do that, but it seems to be a remarkably common thing to do.
They probably made their own web framework because nothing good existed at the time.