Beyonce attends the Met Gala in New York City. Getty Images

Take a moment to check where the clothes you're wearing were made. If you're anything like me, you might have on a shirt and shoes made in China, socks manufactured in India, and a pair of trousers from Bangladesh.

The people who made these clothes are probably not dissimilar from the Sri Lankans who make the clothes for Beyoncé Knowles's new clothing line for Topshop. They have appallingly hard lives, almost unimaginable to anyone used to the Western world. It is hardly a comfort to point out that the jobs they have are better than the alternatives, yet it is something that Good Samaritans in the West would do well to remember.

Consider two possible responses by Beyoncé to the condemnation she has faced for reportedly employing labour at 44p an hour, which is characteristic of a sweatshop. The first is that she could cancel her contract with the Sri Lankan factory and find a new one in a richer country where standards are higher – the simple response that boycotts of sweatshops seems to demand. The other is that she could demand that wages are raised in this particular factory, and charge Western consumers more.

The problems with the first reaction are obvious. Moving jobs away from poor countries to richer ones is really not good at all for poor people who once worked in those jobs. A 2006 study by economists Ben Powell and David Skarbek found that wages in sweatshops, though low by Western standards, were higher than average wages in nearly all of the countries they operated in. In half of the countries studied, sweatshop wages were over three times the national average.

It is a truism that these jobs must be the best jobs available to these workers. Why would they take them if they had a better alternative option? As one of the workers told The Sun, ""We had to come and work here because our father could not afford to feed us and there are no jobs there." Boycotting the factory would not help her one bit.

What, though, of improving the standards in these factories? This is superficially appealing, but it's of limited value at best. For a start, to sell at all these clothes have to be priced competitively. Paying high wages is no good if no one's actually buying what you're selling.

But the much bigger problem is that if wages rise disproportionately in this sector then more skilled workers will start to apply for these jobs, making it harder for the poorest people to work there. If we started to pay fast food employees substantially more than we do now, higher skilled people would start to apply for jobs at your local burger joint, and the people who rely on them now would be squeezed out.

What's more, if costs rise too much the sweatshops themselves may shut down. American labour unions are particularly aggressive in demanding that much poorer countries enact costly health and safety rules that drive up costs so much that they cannot compete. This is protectionism masquerading as humanitarianism and it is particularly pernicious because so many people naively believe that they are doing good.

Beyonce's Ivy Park
Beyonce's Ivy Park collection goes on sale at Topshop on April 14, 2016 in London. Getty Images

This is all cause for restraint, though, not inaction. There is some evidence that campaigns to improve conditions for sweatshop workers in Indonesia have done so without creating significant unemployment, although some smaller factories did close down. Too much 'help' can really hurt: Unicef concluded that international campaigns to reduce child labour in Bangladesh in the 1990s led to children seeking incomes in much worse ways, such as prostitution and street hustling.

In short, sweatshops are bad, but the alternatives are worse – often much worse. But there is more to the defence than simple resignation that the world is a harsh place. In some respects sweatshops are very valuable, very good drivers of economic progress, helping today's workers ensure that their children live much better lives.

A study of sweatshops in Bangladesh found that they significantly improved opportunities for young women, who were less likely to get pregnant or married off at a very young age if they lived within range of a sweatshop, and this effect was strongest in 12-to-18-year-olds. School enrolments were 38% higher for girls living near a sweatshop too, because their parents could afford to keep them in education for longer.

Higher income from foreign investment means more money for domestic investment, which means higher incomes in the longer term too. The sort of factories that Beyoncé has been slated for using were once commonplace in the UK and most other developed nations, and helped us grow out of them. Well-intentioned Westerners risk pulling away the ladder that Sri Lankans need to climb so that they too can enjoy the sorts of lives we have.

The best we can do is not to take these jobs away but to expand the options available to poor developing world workers. Guest worker programmes could be introduced and expanded to allow more of the global poor to come and work in Britain, which would increase their incomes by between ten and twenty times.

The Common Agricultural Policy and Common External Tariff subsidise rich farmers and protect European producers from competition from poorer countries. They are a stain on our conscience and should be abolished so that poor people can trade more easily with us. And GiveWell's top charities do exceptionally good and important work in the world's poorest countries – anyone who wants to help the world's poor should give more to them.

There is much more we can and should do, but boycotting goods made in sweatshops won't help. Buying the clothes they make boosts their incomes and gives them better jobs than they can hope for otherwise. In the battle between the do-gooders and Beyoncé, it is Ms Knowles who is truly on the side of the world's poor.

Sam Bowman is Executive Director of the Adam Smith Institute, a libertarian think tank.