The expression dates back to the English Crown’s first efforts to control the Irish by outlawing their language and customs.
But the unruly Irish were just that, and by the fifteenth century the English still controlled only a small area around Dublin, protected by a fortification called “The Pale,” meaning sharp sticks (i.e., impaled).
To the British, to go “beyond The Pale” meant that you were entering the uncivilized realm of the wild Irish.
These days, extreme behavior is often called “beyond the pale”.