One example is raising kids in country A while you are employed by country B. OK, you pay sales tax and maybe property tax in country A but country A is expecting payroll tax to help pay for education, and healthcare fees based on your income to help pay for healthcare.
Another example is insurance. If you work for google you can probably sue them when your WFH desk bought with inadequate WFH allowance collapses and breaks your ankle. But does google's insurance cover the case of working in your summer home in Iran, or is able to make a payment to an Iranian hospital? Not likely. At least it's a moot point compared to the embargo violation and export control violation that now comes to light.
Another example is just legal stuff in general. "Work" in US and live in Spain? What's the legality of the NDA you signed? What's the process to fire you? Who knows, but a company sure doesn't want these uncertainties times the number of countries its remote workers are located.
Mature companies know all of this and put rules in place and either open a proper office when it's justified or hire a middleman company who then hires the remote worker as a contractor.
[1] I use US and Japan specifically because I just finished a 10 year stint in Japan and well, it's common online to see Americans living in Japan on a marriage visa or something, trying to get remote/American salaries and totally missing the basic requirement: work done in Japan is taxed in Japan and also subject to other Japanese regulation. So not only can you be in trouble for not paying taxes in Japan, your company can be in trouble when it realizes that by paying an employee in Japan, it is also bound by Japanese labour law. My understanding is that this works similarly for most country pairs.