This functionality is controlled by a GLFW window flag, GLFW_AUTO_ICONIFY (https://www.glfw.org/docs/latest/window_guide.html#window_hints_wnd), which you can disable. Do note that this makes the window topmost (https://discourse.glfw.org/t/clarification-of-borderless-fullscreen-and-borderless-windowed-modes/1235/2), so you can't put other windows on top of the borderless fullscreen window - this may cause confusion for those with one screen. The solution I've implemented in my mod, Borderless Mining, is to bypass GLFW's concept of fullscreen and just make a window with no decoration that fills the screen.
This is a "feature" of GLFW, see https://www.glfw.org/docs/latest/window_guide.html#window_windowed_full_screen.
This seems to be a reintroduction of MC-175431 after the 1.19 Option refactor. It might have been intended to save the options file in the option change listener instead of here?