Various tools hosted on Github can be considered dual-use (i.e. AES/TLS libraries). Furthermore, Microsoft was made to apply sanctions against Karim Khan of the ICC for his involvement in investigating the genocide of Palestinians; I doubt Microsoft would be granted an exception so they can serve Hamas' greatest supporter after that.
I don't know if Microsoft has applied for any exceptions, but even if they did, I doubt they'd be able to get them. That's on top of the probability of bad publicity ("Microsoft wants to cut deal with Iran") and the lack of incentive you mentioned.