Although not on the most direct route from SF to Yosemite, the pleasant little community of Oakhurst is not too far off line. It looks like the Comfort Inn in Oakhurst has 5 rooms available at fairly reasonable rates. That is only 20 minutes or so from the south entrance to the park, and a bit over an hour from the Valley via the tunnel and famous Valley View viewpoint.