In his latest Legends and Lore article Monte Cook posits that:
"levels serve as a means to incentivize people to keep playing the game"
Whilst this may be true for the majority of MMORPGs and those time wasting level machines on facebook, it is not necessarily the case for D&D and other level based RPGs.
Levels are a Challenge Metric
D&D 3e introduced the concept of the Challenge Rating (CR) as a device to scale your encounters / scenario to match the levels of the PCs in your group, and before CR, we used a Monster's Hit Die. However, the constant used in both systems was the PCs level system. Successive layers of "Customizeable Elements" such as powers, feats, skills and kits have only added to the complexity of character generation and consequently devalued "Levels" as an effective constant.
Players use this metric during play to judge their own survivability and determine their reactions when faced with obviously superior force strength or capability. For example a lower level party will often resort to non combat means to overcome an encounter if they suspect that there is a high chance that they won't survive. Being a hero doesn't always have to mean slaughtering the enemy, particularly if a GM has intentionally used the monsters level to frighten or provoke a non-combat solution.
Storytelling Incentivizes Continued Play
In the same way that the storyline of a soap opera incentivizes millions of people to keep watching, the continuation or completion of a plot in an RPG incentivizes players to keep playing. Although min-maxing and power-gaming exist as styles of play these are generally regarded in a negative light and are discouraged in favour of more positive storytelling or cooperative styles.
Posturing vs Retrospection
Hands up those who've had (or overheard) a conversation before a game session which goes like this:
"My 5th level fighter will kick your 5th level rogue's ass..."
or after a session:
"Remember when I saved your ass by taking out that orc chief..."
As a DM, I know which one I'd prefer to hear my players use.