That's why I'm opposed to free trade and want fair trade instead. Like, it's not wrong for e.g. EU to impose a tax on products/services produced by companies abroad that have much less strict environmental/employment laws.
Example: poor countries can't afford the level of worker safety that rich countries can. So do you not trade with them? They then stay poor and work as subsistence farmers, something a lot worse than working in a sweatshop.