I am not sure that something which is not illegal must be morally just: but more importantly, we are talking about inter-national and bi-lateral issues. It was not strictly illegal that the USA has invaded several countries (as did the USSR and numerous Africa countries), and it was perfectly legal for South Africa to impose apartheid, but that does not make it moral or just. Transnational corporations behave badly not infrequently in several ways and not paying taxes is one - this is an abuse of power since states struggle to control such behaviour and corporations threaten to take their business and jobs away if they face any tax in any country. Hence tax havens flourish by offering a location with minimal tax.