A scapegoat. One who is singled out for blame or punishment.
It seems an odd notion to us now that a royal court would have kept a child for the purpose of beating him when the crown prince did wrong. That's just what did happen though. Whipping Boy was an established position at the English court during the Tudor and Stuart monarchies of the 15th and 16th centuries. This may not have been quite as bad as it sounds. The whipping boys weren't hapless street urchins living a life of torment, but high-born companions to the royal princes. They were educated with the princes and shared many of the privileges of royalty. The downside was that, if the prince did wrong, the whipping boy was punished. It was considered a form of punishment to the prince that someone he cared about was made to suffer.
The strangeness of the concept is a little easier to understand when put into context. The Divine Right of Kings was the belief that legitimate kings were appointed by God and so were answerable to God alone. James I (a.k.a. 'The Wisest Fool in Christendom'), in his 'Speech Before Parliament', 1609, declared:
"The state of monarchy is the supremest thing upon earth; for kings are not only God's lieutenants upon earth, and sit upon God's throne, but even by God himself they are called Gods."
That belief, although widely disputed and a root cause of the English Civil War, was accepted at court at the time. Even touching the monarch was, and still is, considered improper. It's not surprising then that James's son and heir Charles was not considered someone whom his tutors could flog. Charles's whipping boy was his close friend William Murray, so recorded in 1715 by Gilbert Burnet in History of his own time:
"William Murray of the bed-chamber, that had been whipping boy to King Charles the first."
In later life Murray may well have considered the beatings worthwhile. In 1626, he moved into the palatial Ham House. In 1643, Charles made him the 1st. Earl of Dysart.
The term 'whipping boy' is first recorded in print in Charles I's reign, by John Trapp, in his A commentary or exposition upon the five books of Moses:
"Rebuke before all: yet not as if they were whipping boyes."
It isn't until much later that the term is used allusively, i.e. referring to a scapegoat but with no actual whipping involved. In The Times, October 1857, we have:
"Or will the public have still reason to say that M. Migdeon, even supposing all that has been brought against him true, is merely the whipping boy?"
The word 'scapegoat' is interesting in itself and has a similar derivation to 'whipping boy'. It is Biblical in origin and is recorded by 1530 in Tyndale's Bible. In the Mosaic ritual of the Day of Atonement, one of two goats was sent alive into the wilderness, the sins of the people having been symbolically laid upon it, while the other was sacrificed.
These verses are from Leviticus XVI (King James Version):
And he shall take the two goats, and present them before the Lord at the door of the tabernacle of the congregation.
And Aaron shall cast lots upon the two goats; one lot for the Lord, and the other lot for the scapegoat.