This leaves them with two choices - either they stop doing business in said countries, or maximize profits by conducting business in those countries by loosening their belief system to include the countries' negatives, such as censorship of political discourse in this case.
The censorship is taking place either way right? Why not take the money?
Their morality is just conditional
Being based out of mostly western countries, corporations like Google and Microsoft found the belief system of quitting Russian business initiatives as most acceptable to the public, and hence executed that plan. A western worldview where it may have been more acceptable for Russia to initiate a war would have resulted in a different outcome.
Do you really believe big tech cared about some wArCrImEs, instead of getting a call from their lobbyist/investor/gov.account advising them to play along, or else?
JFYI, YouTube (and the whole of Google) is still operational in Russia, I can still use my iPhone, pay for iCloud, and buy a new one as soon as I want.
Business is business, I don't understand why people ever suppose it would be fighting for their political goals.