(1) relatively low capital to get started due to the relative simplicity of the equipment and the age of the industry and equipment designs
(2) mostly low skilled, meaning that the government doesn’t have to invest a ton in training or wait a long time for enough folks to get the needed skills
(3) safer than most industries
(4) more or less guaranteed domestic market (everyone needs clothes)
Basically using it as the first step towards industrialization.
Why textiles? Because its the easiest thing to manufacture. Clothing is light. So textiles are often made wherever there is cheap labor. They'd rather get a factory making iPhones, but that isn't happening.
Besides that, if you stop soaking up the supply by accepting imports, you certainly aren't going to be able to export competitively.
In my opinion, third world countries should be sending their folks to Delaware to study corporate law, and to various island nations to study offshore banking. After they have the principles down, pass legislation that turns the country into a sweatshop/boiler-room for intellectual property lawsuits and tax avoidance schemes.
The current state of the world is that you have to be rich to get rich, so if you pretend to be rich for long enough, you have a decent chance of either making that real or collapsing in a boneless pile of fraud. And if the latter would happen anyway, there's really no point in actually doing anything useful or productive to keep up appearances.
At some point, the contents of category Y start looking a little thin on the ground.