It is a tradition in some countries to playfully spank someone on their birthday, once for each year in the new age. (In other words, a 12-year-old would be spanked 12 times.)
In my experience, this gets talked about more than it actually gets done. People might tease about it, but not everyone gets smacked on the bottom just because it's their birthday. And, even if people have gotten spanked, I imagine the tradition is trending downward.
As for the term in this passage, spanking machine, as others have mentioned in comments, it's not a commonly-used term. However, I think its meaning can be deduced. One person might strike someone repeatedly in a mechanical way, or a group of partygoers might take turns in a rhythmic fashion. Either one of these could turn the spanker(s) into a spanking machine.
One example of a related tradition is found in the Wikipedia article for running the gauntlet:
The original meanings of the phrase notwithstanding, the expression (to run) the gauntlet has been applied to various less severe punishments or tests, often consisting of consecutive blows or tasks endured sequentially and delivered collectively, especially by colleagues such as roommates or fraternity brothers. As these do not usually cause serious injuries, only bearable pain, the rituals are sometimes eagerly anticipated by the initiate as a sign of acceptance into a more prestigious group.
The phrase running the gauntlet has also been used, informally, to express the idea of a public but painless, ritual humiliation such as the walk of shame or perp walk, or to indicate a series of difficult trials that one must overcome.
It's meant to be playful fun, but could easily get out of hand and cross the boundaries of civility, politeness, and appropriateness.
It's also worth noting that the word machine can also be used figuratively and applied to people. For example, in a recent headline, hockey player Patrick Laine was called a "goal scoring machine" after scoring 76 goals while still being under the age of 20. In a 2017 article, baseball slugger Aaron Judge was said to be "more than just a home run machine." The word can be used to describe an organization as well. One business article states:
The number of lawsuits filed by NCT has become a national phenomena with one Businessweek reporter describing NCT as a “lawsuit machine,” filing more than one lawsuit per day in some states.
In a similar way, people dishing out birthday spankings could be said to be a "spanking machine."