Yes, this is very unfortunate decision. Same that Stackoverflow chose to do. I am liable to call this dark pattern... There’s no technical reason for this that I can think of. Guess our usage data locked in is that much more profitable.
If that were the case there could be an option to set this on browser basis, using the usual cookies and local storage. Dark mode is not (just) a theme. It's about accessibility. Its benefits vary by time of day and screen in use.
Also, I don't want to use Github when authorized to do things on company repos when browsing something completely unrelated in my own time and own devices. Thus this option is not available to me without creating a dummy account. I also have to change this manually whenever environment changes. With the accompanying blinding flash of light on unfortunate late night sessions.
I'll admit there might be other considerations than funnelling users to registering and using their accounts. It's just not a good user experience and misunderstanding of the target audience.