To allow the maintainers of the projects to see in the traffic analytics where an influx of stars comes from, I guess
https://docs.github.com/en/repositories/viewing-activity-and...
https://docs.github.com/en/repositories/viewing-activity-and...
A user agent SHOULD NOT send a Referer header field if the referring resource was accessed with a secure protocol and the request target has an origin differing from that of the referring resource, unless the referring resource explicitly allows Referer to be sent. A user agent MUST NOT send a Referer header field in an unsecured HTTP request if the referring resource was accessed with a secure protocol.
In other words, it's not guaranteed that this Referer header is set. One can of course choose to remove the query parameter.