Thalidomide was first marketed in 1957 as a multi-use sedative. It later became popular to treat morning sickness in pregnancy. By 1961, it was realised that the drug was causing severe malformation of the limbs in infants.
The figures for the total number of people damaged by the drug are disputed - most studies cite the number at around 10,000, but the UK-based Thalidomide Society puts the figure at over 24,000. Source
At least 10 different theories have been proposed to provide an explanation of how the drug causes the growth defects. (The latest research suggest that it might be connected to the drug's potential to restrict the growth of newly forming blood vessels.)
Thalidomide is still being prescribed in the treatment of, and some forms of leprosy. The chemical mechanisms by which it helps to treat these diseases has also not yet been clarified.
Further reading from University of Aberdeen, Scotland.