Nobody knows why names become popular, but it may be that parents named their daughters after queens or saints. Since there were many of both with the name Margaret, many parents would use the name for their girls. At the current time, the name appears to be going out of favor.