Linkedin was because everyone needed to have a “social” strategy back then and apart from maybe Dynamics, there’s no real synergy (I don’t like that word) between LinkedIn and Microsoft’s other businesses.
The GitHub acquisition was part of their plan to start repairing their fractured relationship with developers - almost a PR tool.
In both cases tight integration with the rest of the organisation makes less sense than Salesforce buying Slack - which is something that could be tied directly into Salesforce’s core business.