James II had become King in 1437 at age 6 following the assassination of his father. He had regents, however, who presumably prevented him from outlawing timeout chairs and other anathemas. But when he was 20, no one stopped him from outlawing golf and football. The country was under constant threat of invasion, and the King wanted males over age twelve to undergo military training, and practice skills like archery. Instead, they preferred to chase balls around (and still do, it seems).
The 1457 ban was repeated in 1471 by James III and again in 1491 by James IV, so clearly it wasn’t obeyed or enforced effectively. When the ban was lifted in 1502 in Perth, the Kirk (church) continued to complain about it, because of playing on the Sabbath. King James VI decreed in 1618 that golf on the Sabbath was acceptable, so long as it was not played during the times of service, because Sunday was the only day the great mass of people would have free to play.