It helps to consider the purpose of spanking in the discipline toolbox. In my experience, spanking alone is worthless in terms of correcting behavior. Parents need to explain to children why exactly their behavior is wrong in addition (and usually before) corporal punishment. For instance, when our infants tried to bite us (or each other), we'd say "no bite" and lightly flick their cheek. The goal was to associate the act of biting someone else with an unpleasant feeling and also get into the habit of teaching rather than just punishing.
As our children have grown, the education element has become more important. Instead of "no bite", we now explain in full sentences that biting hurts other people. If we use spanking, it comes at the end of a discussion about what the punishment is for. Over time, that very conversation becomes the thing our children dread more than spanking itself. Like your twelve-year-old, my children sometimes prefer a quick spank compared to the conversation about their behavior.
By the time my oldest was 12, we'd long stopped using spanks. At that age, my disapproval was far more effective than any other form of punishment. For one of my children, spanking has never worked as well as simply holding them in my lap. So it requires good judgement to determine if spanking is useful or not; age alone isn't really the determining factor.
I'd suggest talking with your children about what punishments they think are appropriate. I had this conversation with my oldest and we agreed grounding was not a good discipline for him since he enjoyed spending time alone in his room. We agreed that withholding some of his allowance was a better punishment as a general rule. For my preschoolers, I offer a choice between several appropriate punishments. One pleasant side effect is that they spend (a little) less energy complaining about the punishment and seem more engaged when I talk with them about their behavior.
I should also point out that spanking can make matters worse if it isn't grounded with a reason for the punishment or if the parent loses control of their temper. While it's best to discipline as soon as possible, I've occasionally needed to just to walk away from the situation until my own anger is under control. In the few times I haven't done that and punished out of anger, I've needed to come back to my child later to apologize. Again, the key is to focus on education rather than punishment.