Was there ever any economist claiming that such institutions were vital and if we started regulating them to standards the economy and thus people would suffer even more?
One of the most compelling arguments for sweatshops was (and is) personal autonomy. No one was forced to work in them. Anyone who was dissatisfied could leave at any time. In fact, workers appreciated the opportunity to work--even in harsh conditions--because the alternative was often death and the degradation of their family. The modern concept that people are entitled to a certain level of wealth is just that--modern , and chiefly First World. This is not to say the conditions or work were anything less than brutal, but contemporary mores accepted that life was often difficult, often to the point of brutality.
Many economists of the time -- and, indeed, even many economists today -- would essentially say that regulation would lead to elevated unemployment: if a factory were required to spend more per-worker, then fewer workers would be worth hiring. In addition, it would be a violation of personal autonomy was /u/muj561 mentions.
A school known as Manchester Liberalism was the predominant strain of economic thought that justified a laissez-faire economy. By the turn of the 20th century, Manchester Liberalism had to some degree passed its high water-mark, and economists like Knut Wicksell were developing new theories that would challenge some aspects of Manchester Liberalism -- and, of course, there were also more radical Marxist movements challenging it -- but circa 1900 laissez-faire and Manchester liberalism was the dominant school as far as respectable opinion went.