I've found the solution from the doc of materialui (https://material-ui.com/guides/server-rendering/) but I still don't know the reason.
Why the style works in the first time rendering but disappear in the second time? I know SSR will generate the html template with css to the client side in each request so the style should still work because it is injected in the html template.
In the document, it mentioned that "On the client side, the CSS will be injected a second time before removing the server-side injected CSS." However, I don't know why it needs to be removed. CSS is injected in the html template in each request so it will not cause any crash in my thinking and why the style will not disappear after removed the injected css.