I was always taught that the downhill hiker yields to the uphill hiker because it is harder for the uphill hiker to get moving again once they stop.
This also can be a great morale booster for the exhausted hiker slogging uphill. Sometimes they just want to keep going before they collapse. Of course, many of these will gladly stop for a break while the downhill flies by. Still, I always yield to uphill hikers as a courtesy as they are doing the hard work.