Any hopper has the abilities to:
- pull items from above, from any container or open space
- push them out into any container its output points into.
Locking a hopper, by powering it up, blocks both abilities simultaneously - it acts as an inert container - which means other, non-blocked hoppers can still insert items into it, or suck them out.
The sorter requires to pull the items from the 'stream' above, and simultaneously keep it locked in absence of the 'excess' items to keep the filter items in. This is achieved by using two hoppers: the top one holds the filter items and can pull items from the stream as long as it has room to grab them, and signal 'excess', while the bottom one is responsible for pulling the excess out, and not pulling any when there's just the "normal" amount left. That means the bottom hopper's sucking ability is locked out by a redstone torch in absence of sufficiently strong signal "from above" (its pushing functionality is locked too, which is an undesired though mostly harmless side effect). The top hopper's sucking ability is only restricted by the capacity, but we still need to cripple its pushing ability - otherwise the fact the bottom hopper is locked will be moot, as it can still have items pushed into, like any inert container could. In order to prevent that, the output of the top ('filter') hopper must be directed into any bogus direction where there's no container to push items into - for example, into the comparator. That way if the bottom hopper is locked, the items stay in the top hopper and aren't moved anywhere.
Failure to point the top hopper in a "wrong" direction is one of most common mistakes when building sorters.