What they're now learning is that this decision is incompatible with certain forms of revenue like military or immigration-enforcement contracts. That doesn't mean that the right answer is that you should accept such forms of revenue and reject the employees who don't support it. That just means you have to choose. What they're regretting is simply that they can't have it both ways.
(Also, GitHub in particular is trying to endorse a particular form of politics at work - they've been defending the practices of ICE in their internal and external communications. If opposition to ICE is political, support of ICE is political too, no?)
Google and GitHub are trying to turn into IBM and Oracle. That's fine, but they should remember that they were originally trying to beat IBM and Oracle. And they shouldn't be surprised if a company that explicitly embraces activist engineers and forswears sources of revenue incompatible with that activism, a company that says "We will talk about politics at the workplace and this is our particular form of politics," one day beats the pants off them.