Spam is defined as “unsolicited bulk email”.
Https://spamhaus.org/consumer/definition
It’s a one off, not hulk, so recruiters emailing developer emails found on GitHub isn’t spamming.
Nor is the email address being sold in this case so that aspect of GitHub terms is not being violated.
So in fact you’re wrong and it’s perfectly legitimate for recruiters to use email addresses from GitHub and email them asking about jobs.