One of the problems with summer camping in California is that many campgrounds take reservations and those that are first-come, first-served may fill up early (like in the morning) if they are popular. 4WD gives you options but I realize that you have 2WD.
According to
www.weatherbase.com, the average high temperature in Death Valley in July is 115 although it drops to 113 degrees in August. There will be plenty of spaces to camp in the paved Sunset Campground (it is a parking lot) but no shade! So, a drive through is a better idea. Driving down to Badwater and back will add an hour plus time to get out and get your picture taken at the lowest place in North America.
Assuming that you are coming from Las Vegas, I'd leave as early as you can and take Highway 190 through Death Valley to Highway 395. Highway 395 follows the backside of the Sierras all of the way to Tahoe and is beautiful high desert. You'll be at around 7,000' elevation with the Sierras going up to 12,000-13,000' in elevation a few miles to the west.
Las Vegas to Bishop, CA via Death Valley takes about 5 hours not including a detour to Badwater or lunch stops, etc. and there is camping all along Highway 395. You can also boondock off of Highway 395 and there are a lot of dirt roads which you can turn off onto to find a place for the night. However, the further north toward Highway 120 you get, the more time you'll have in Yosemite. For example, another 1.5 hours will get you to the Highway 120 turnoff to Yosemite. If you decide to spend more time on the road that day, turn west on Highway 120 (if it is near time to eat, the Whoa Nellie Deli in the Mobile gas station is great). A couple miles up the road is a turnoff to some County campgrounds along Lee Vining Creek. We've camped there in August and there were plenty of spots. Not a great campground but at least a place to stay for sure. The next day, continue west on Highway 120 over Tioga Pass (9,943' in elevation) and on to the Tuolumne Meadows area. This huge, high meadow is one of our favorite places. Camping along this section of Highway 120 is all first-come, first-served and very popular. The scenery along this section of highway is gorgeous...open meadows, granite, etc. Take your time (it has a 45 mph speed limit also) and enjoy the Yosemite high country. There are only a couple of places to eat along here...at the small burger place next to the Tuolumne Meadows general store (both are in tents!) or at the old stage stop at White Wolf, a mile or so off of the highway.
When you reach Crane Flat, see if there is space at the Crane Flat campground just west of the stop sign. If not, you can turn west on Highway 120 and see if there are camping spots at Hogdon Meadows near the 120 Entrance Station to the Park, 8 miles further up the road. This campground is usually the last to fill up since, although it has regular flush toilets, there isn't anything to do here.
If this campground is also full, I'd suggest figuring out where you are going to spend that night before heading into the Valley. I don't know if there is cell coverage at the Entrance Station but there is a pay phone (there might be a sign with phone numbers but I'd havethem with you). You can call the Yosemite Lodge in the Valley and ask if they have a room (room reservations in Yosemite can be made 1 year plus 1 day in advance and people with reservations start canceling a couple of days before arrival. My next suggestion would be Cedar Lodge (
http://www.stayyosemitecedarlodge.com/) which is 8 miles out of the Park on Highway 140. We've stayed here a number of times...clean rooms, etc. Not in-expensive though in the prime summer months! There is also a motel in El Portal a couple miles closer to the Park (Yosemite View) but it is even more expensive. The next closest option is in Mariposa, 24 miles further west. There is camping along the river in only a couple of places. One is on the north side of the river opposite Cedar Lodge but it only has a few spaces which are paved parking spots along the road on that side of the river. There are also three BLM campgrounds further west on the way toward Mariposa:
http://www.blm.gov/ca/st/en/fo/folsom/m ... errec.html
One of them is walk in only and the only two only have 9 camping spots between them. I don't know what the usage of these campgrounds is during the summer. It can be hot in the summer so maybe there would be spots available. There is also a KOA campground on the highway toward Mariposa although we've never stopped there.
Once you have a place to stay, head toward the Valley. There is a free shuttle all-year in the Valley...park at Camp Curry and take the shuttle to the Visitor Center to get oriented. From there, you can take the shuttle to Yosemite Falls but don't be surprised is the falls is only a trickle this year since the snow pack is very light so far. You'll see Yosemite Falls on the north side of the valley as you drive to Camp Curry. If you have the time, take the shuttle to Happy Isles and hike up the John Muir Trail (paved) at least to the bridge over the Merced River where you can see Vernal Falls. Remember that the Valley can get warm (90 degrees) during the summer. If you have a second day, I'd drive up to Glacier Point where you can see Half Dome and also look straight down to the Valley. I'd also visit the Mariposa Grove of Giant Sequoias...check the Yosemite NP website for information on the free shuttle and parking problems during the summer at the grove.
To head home, I'd backtrack to Crane Flat and then continue west on Highway 120 to Groveland and on to the gold rush town of Chinese Camp and turn north on Highway 49 toward Sonora. The Columbia State Park north of Sonora is interesting...a basically intact gold rush town. Continuing north on Highway 49, there are several highways which cross back over the Sierras such as Highway 4 (a good road to the top of the range but narrow and steep on the backside) or 88 which is good all of the way. Once over the range, you can make your way to I-80.