From what I gather (mostly by observing Russian internet trolls, mind you, and by being a Russian internet troll myself), the main reasons are:
Putin supporters claim very high, nearly unanimous level of, well, support for Putin. Those "minus two percent" may look insignificant enough, but keep in mind that Navalny's supporters are probably the most discontent and politically active part of the population, so most of them would go vote, while many Putin's supporters wouldn't, because why bother, he wins every election anyway. Therefore the number of actual votes Navalny gets could be much higher that what you get from randomized opinion polls. Not enough to win, but maybe enough to shake the image of "unanimity". (IIRC, he ran for the mayor of Moscow and his numbers, although not winning, were surprisingly high.)
Lawfully or not, Navalny was accused of some crimes and sued before. Quite possibly for purely political reasons, e. g. to remove him from the political stage when it wasn't clear how much support he is going to get. Even though it could now work in Putin's favor to let him stand for election so that everybody could see his paltry 2%, that would require dropping the criminal charges, thus admitting they were politically motivated in the first place, thus admitting Putin was not so confident in his unanimous support and would use unlawful means of silencing his opponents, etc., etc. Not gonna happen.
Now, Navalny mostly gets support through internet-based media, he has no access to national TV, etc., which cuts off a big part of his potential audience. That would change if he is allowed to run for the election, because then he would have some mandatory TV time. Probably not gonna get many more supporters among the older generation of people who don't use internet, but who knows. (this is mentioned in the @Gramatik's answer as well)
If the [illusion of] unanimity is so important, why not bar the other contenders (Communists, LDPR etc.)? They are widely regarded as Kremlin's convenient "pocket opposition": they know their place; their opposing stances are quite moderate; they've been in politics since forever, always get their share of votes, but nothing significant ever comes out of it. Besides, giving people an [illusion of] choice is also important.