Ooooh... I remember The Spanking Spoon And yes, I deserved it every time. Sorry Mom. ;-)
In Proverbs multiple times, but not in that precise wording:
10:13 In the lips of him that hath understanding wisdom is found: but a rod is for the back of him that is void of understanding.
13:24 He that spareth his rod hateth his son: but he that loveth him chasteneth him betimes.
22:15 Foolishness is bound in the heart of a child; but the rod of correction shall drive it far from him.
23:13 Withhold not correction from the child: for if thou beatest him with the rod, he shall not die.
23:14 Thou shalt beat him with the rod, and shalt deliver his soul from hell.
26:3 A whip for the horse, a bridle for the ass, and a rod for the fool's back.
29:15 The rod and reproof give wisdom: but a child left to himself bringeth his mother to shame.
Note: in Biblical usage a "fool" is someone without moral sense, not just an unintelligent person