As pointed out by @jamesqf in the comment below, there exist many birds like quail and pheasants that run and walk rather than hop. Also, there are several flightless birds like ostriches, emus, rheas that do the same. But it is also true that sparrows don't walk or run but hop. The question now is- why?
There is an interesting fact- both Quail and Pheasant are ground nesting birds.
Now, the reason why we do not see sparrows running like pheasants is because sparrows rely more on their ability to fly for survival and getting around. So, a sparrow will rather fly the distance than run. The reason for this might be its smaller size which makes it more efficient and safe during flight.
But the question is- why don't sparrows walk? Why do they hop? Quails (video) and Pheasants(video) certainly walk even for short distance.
Just before a flight, all birds jump to power their flight. So, if a sparrow hops around rather than walking around, it can convert any of these jumps into a full flight in the case of an unexpected need. This again comes down to sparrow's heavy reliance on flight to escape danger. Because of their light weight, hopping rather than walking is less costly for a sparrows.
Whereas in a normal situation, Quails and Pheasants would rather run to build the necessary momentum to initiate a flight. But they walk even for shorter distance because they are heavier than a sparrow, and walking for them is more efficient than hopping. But in worst case scenario, even birds like Quails can simply jump into a flight, as can be seen in this video if you watch it in slow motion.
Edit: another factor that might influence whether a certain bird hops or walks is the irregularity of the terrain with respect to the size of the bird. The terrain is relatively more irregular for smaller birds (there are obstacles like twigs, stones, grass etc), hence making hopping a better option than walking.
There are many kinds of birds that each choose whether to walk or hop. Here i present a small categorization with video evidence to bring out some pattern if any. You might need to watch some of the videos in slow motion.
Birds that hop:
Birds that walk