Edit:
Since theres been some confusion with dates
In 2016 github made site side searching login only and hid the search bar if you werent logged in. This didnt include searching within a repository so that could still be done, just not all repositories
This year was the change being referred to in this link which made repository level searching require logging in
Blog post: https://github.blog/changelog/2023-06-07-code-search-now-requires-login/
Well for the experience of users, cookies/tracking/having to log in.
Personally, I’m annoyed when I’m trying to do a basic function and am forced to log in. I’m not affected by this particular case with GitHub, but as a user where this happens elsewhere it is annoying.
I’d be interested in the rationale behind the decision, asking your same question to them. Why do they need account login to search repositories?