With a small, thin wing and low-bypass engine, the JSF is going to be less able to throttle back and ration fuel than an AV-8B in a recovery situation. One result is that usable operational radius will be highly dependent on recovery scenarios and (consequently) fuel reserves overhead the ship.
The harrier will always be a subsonic aircraft, which is a fundamental and potential fatal disadvantage.
Thew F-35's range can be extended. So which do you choose? They choose the F-35 and the Harrier is history.
BTW, the AV-8B's combat range doesn't look as good as the F-35 according to that PDF.