William Wordsworth was an English Romantic poet. Romantic poets often wrote about and celebrated the natural world, which they thought of as beautiful and beyond compare. Romantic poets also often described the natural world has having palliative properties. In other words, the natural world, they said, could soothe the mind.
Arguably, William Wordsworth wrote "The Tables Turned" for people like the "friend" in the poem who neglect the natural world for their studies and their books. He wanted people to appreciate, enjoy, and benefit from all that the natural world has to offer. Indeed, in the first stanza of the poem, he appeals to his friend to "quit (his) books" and leave behind all of his "toil and trouble." And in stanza two, Wordsworth tells his friend to instead appreciate "The sun above the mountain's head."
The rest of the poem follows much the same pattern. The poet describes the "endless strife" of books and the life indoors and encourages people instead to "Come forth into the light of things (and) / Let Nature be (their) teacher." The implication is that people can learn more from nature than they can from their books. This idea is reiterated in the final stanza, when Wordsworth writes that nature "May teach you more of man; / Of moral evil and of good / Than all the sages can."