Working remotely for a foreign corporation generally isn't against the terms of a tourist visa (consult the specific country you're visiting). All officials I asked had no problem with it, from South America/Asia/Europe (Germany will actually let you stay longer, up to 2 years, if you're a remote worker/freelancer). You do need a work visa if you're planning to do work for a company that exists locally (competing with the locals, etc).
It was hugely income tax advantageous. There's a huge US tax credit if you aren't living in the US (your first $95-120k tax free), and I wasn't staying long enough in any country to meet their reporting requirements.