@ Mikey Yes, there is a risk. The point really is that this is a balance of risk versus benefit.
The side effects and complications that it treats in patients with leprosy is extremely debilitating,very painful and disfiguring, and it is much more effective in controlling ENL, with less side effects of its own than the alternative which would be long term cortico-steroid treatment, which carries significant risk of its own.
The risk of deformed babies as a consequence of taking thalidomide is a real one, but such a risk only occurs within a small window during the pregnancy itself. So even though Brazil has one of the largest cohort of patients with leprosy, the number of potential at risk cases is lower than you might think by virtue of some very specific circumstances - women in the first trimester of pregnancy.
The balance of risk versus benefits strongly favours continuing to use thalidomide whilst improving controls over the use of thalidomide by those women most at risk from its teratogenic side effects.