Companies are putting moats around their data (or the data they host) because AI needs data to train its models on. It is the same reason Reddit changed their API access.
I'll even wager 20 imaginary internet coins that Wikipedia will require logins to do any searching within the next year.
In this case I don't think that's the reason. All code on github is not Microsoft's data, is open source and easily downloadable by whoever needs it to train the models.
This is an inconvenience only for humans to force them to have an account