You may want to go on Booking.com or a similar site and try looking for motels in El Portal or Mariposa (all on Route 140), maybe Fish Camp (on 41) or Groveland or Buck Meadows (on 120). They all should get you into the heart of the valley a bit more directly than Mammoth (probably about 1 to 1 1/2 hours, barring traffic delays) and are between SF and the park, which Mammoth isn't. I just did a quick Booking.com search for your dates and found some availablity in Mariposa, for instance.
The sad truth is that if you're looking for good hotels, close in, 5 rooms in the same property, and affordable in high season at the last minute, chances are you'll have to compromise on at least one of those points.