Bradley - PM me and I can give you more detailed info as I live in SF and also did the JMT a couple of summers ago. IMHO the best hostel in SF is at Ft Mason, though it is a couple of miles (but scenic miles) to Amtrak. The Green Tortoise Hostel is a 20 minute walk to Amtrak, but in a more urban setting (eg may be noisier) The Green Tortoise also runs bus trips to Yosemite...
As an alternative, consider airbnb, which allows folks to rent out rooms, apartments, cottages etc on a nightly basis. I just used it in Manhattan a week ago and had a good experience,