Catharine Howard, wife of Henry VIII, introduced pins into England from France. As they were expensive at first, a separate sum for this luxury was granted to the ladies by their husbands. Hence the expression "pin-money."
Henry VIII married Catherine Howard in 1540 and the earliest recorded use of the idea of pin-money appeared in a work published in 1542. That seems a remarkably short time for the idea to catch on, given the age we are considering and the amount of time that was presumably devoted to the actual writing of the work concerned.
It was money given to wealthy ladies to spend as they wanted. As pointed out by factor30 ladies of quality had an abundance of hats thus had to had to have plenty of hat pins to keep them secure. Hence the term pin-money.