I have seen things evolving along the years about this. 20 years ago, microsoft was pure evil, and FUD was their only position about open source in general and linux in particular. But over the year they have somehow realized that linux was the only OS powering data centers around the globe and that developers didn't care anymore about windows when dealing with networked software, even after trying for years to provide azure services based on windows servers crap they finally went for full linux. Their best move was clearly WSL to attract developers in need of desktop machines able to replicate the behavior of their production machines while keeping organizations in the realm of windows. I use WSL daily in my job and even if it is far slower than the bare metal equivalent this is already very usable and mostly reliable. Eventually developers may get fed up with the overhead of crap the windows part of the os introduces in their development flows, but basically it works and organizations are not composed of developers only and unfortunately we have to deal with it.
So after years trying to discredit linux they finally had to embrace it, even if was clearly not their original choice. But for sure microsoft is the kind of ally to open source that you'd better keep an eye on...
Apple is a totally different beast. First the OS is not bad. This is not linux yet it is a real unix system, their didn't try to reinvent the wheel as microsoft did. I've never liked their UI but this is just a matter of taste. All the energy deployed by apple is turned towards building a walled garden, the higher the fence the better. They don't care about server development, so they don't care that linux powers 90% of online machines, they don't care about linux for the mobile because they promote their own ios walled garden, they don't care about openness they just want to ensure that a paid software running on their os will not sell something not going through their own revenue channels, they don't care about being able to fix or reuse hardware, they just want you to buy the new version. So yes I think that avoiding apple is a far more ethical and political positioning than technical.
That said and as I started my reply with this, things change, and no one knows how things will evolve. 20 year ago google motto was "don't be evil" and today their goal is to replicate the walled garden business apple put in place with ChromeOS... so who knows. The only thing I know is that Open Source will remain open thanks to the licences.