Not necessarily. Just give the player a set amount of character points to divide amongst skills and attributes at the start of the game. Even if you remove leveling, the player is still forced to role-play.
There's a difference between playing a character and role-playing a character.
Me, when I play any of the Fallout games, I'm not sitting there thinking of myself as a vault dweller out to survive in the real world.
I'm just someone sitting in a chair, playing a computer game, enjoying the story and gameplay, and working on improving my character.
And that, right there, is why leveling up exists. To give you a means of improving your character. It has nothing to do with role-playing.
Sure, you could get rid of leveling and throw it back on the player improving their playing skills much like a player of, say, Quake would improve by playing and not leveling. That could work, but in the end depending on what the game offered you'd just end up with a shooter/racer/simulation/etc. with a story (unless you had an exceptional developer who could make it a bit more, but honestly how many of those exist any more?).
If you remove leveling, and make the game about improving your playing skills and equipment, you've just substituted equipment for leveling. Although admittedly, you do get better equipment as you play most games as it is, so it wouldn't be that big of a change there. But leveling, and gaining skills and abilities, is a driving force in continuing to play since it gives you a reward, which gives incentive to play more.
Leveling also is pretty helpful to more casual/less hardcore players, at least that's my thinking on the matter. If your reflexes aren't quite good enough in one part of the game, just level and improve some stats to make up for your reflexes. If you can't aim that well, level up and improve a stat that compensates for your aim. If you can't seem to find an item that would help get past a certain quest, level up and get a skill that compensates. Remove leveling, and you remove that compensation from the game and you would lose some of the potential players.
Leveling, for me, gives me a sense that my character is growing and becoming more powerful with experience. If that were removed from the game, I'd be fine with it as long as there was something put in to still give that sense of character growth in the game world beyond whatever I have to come up with myself in my head.