Is it just for the sake of speed for the user to immediately see the HTML code?
Yes, basically, this is done in order to reduce the drawing time of the initial page. The fact is that pages of applications built using React contain little HTML and load a lot of javascript code. After downloading javascript page, as a rule, loads data from the server and after that, in fact, draws the page (Rendering, by the way, is not the fastest operation). While javascript not loaded and the data is not received, the user will see a blank page. On the other hand, if the server gives the finished page, then firstly, it seems that the page loads faster, and secondly, you can save on one or more requests to the server, since all the necessary data is already loaded. It's worth keeping in mind that the browser will still load javascript, and after loading React will create a virtual DOM page, but since it matches the code of the generated page, React will not make any changes (no need to redraw the page). In the worst case, part of the page may change after downloading the updated data, but usually this is not noticeable to the user.
It is believed that the server can generate pages faster than the browser, but I think it depends on which server and which computer the user has. In any case, the advantage of generating a page on the server will be the ability to cache the page by the server, which will give it away almost instantly.
There will be no porridge with java, js code
No, it will not, although it will add some difficulties. But there's nothing you can do, either quickly or difficult.