We went a few years back for a wedding in SF. We did it in 9/10 days as we were short on time off work so it did involve a few days of very heavy driving that I think we'd have preferred to avoid.
We flew into and out of Las Vegas. It was significantly cheaper to do it this way both for flights and car hire.
We had a night in Vegas as we arrived late then went via the Hoover Dam down to Joshua Tree national Park. I think we'd have like to do one day at the grand canyon but simply didn't have the time with our short schedule. We largely bypassed PA staying one night north of it because its an over rated shit hole that we've both been to before and didn't really fancy doing again. From there we headed up the coastal road which I believe you can't do atm because it's closed in places. That does mean that LA to SF is quicker. We had a few days in SF staying out of the city so we didn't have to drive in, instead using public transport. This worked out cheaper for us as a couple and was certainly easier, but might be more expensive for a family. From here we went to a wedding one day and went on a coach trip over the Bridge (which is fab in its own right) to the vineyards North of SF which was great (and actually still fun for the kids) but you could do that staying up there rather than doing a coach trip. In the past (not on this particular trip) I've been to Francis Ford Coppella vineyard which was wonderful and also a movie experience (perhaps not so much one for the kids but worth a mention for others)
Alcatraz is fantastic and I do recommend but you have to book in advance. Fisherman's wharf is nice enough but touristy. Absolutely do a tram car journey.
Word of warning: Ive stayed in SF a few times and enjoyed it, but the homelessness is a shocker and you have to be weary about where you go in the city. One street can be fine but another two along can be rough as sin. Be prepared mentally for it as much as being careful where you go.
From there we met up with a friend in Sacremento and stayed in a place called Jamestown just on the approach to Yosemite. Now we both loved this. This part of California, slightly inland is very different to the coast. I think its really overlooked and less fashionable to visit which is a shame. The hotel we stayed in was amazing. It's a proper little 'western town' and significantly its where they filmed some of the railway scenes for Back to the Future III. You can go visit this. I think we also went to nearby Sonora where there's a couple of museums. It is well worth a visit and perhaps something not necessarily as in the mindset as other places. Personally I'd do one day less in SF to fit it in if I was tight for time. Staying there also, crucially, means you can enter Yosemite early in the day before it starts to get busy. That means you can have a few days in Yosemite but overnight in it for one less (and then perhaps stay just outside the park on the other side the following night which should cost you a touch less and gives you a better starting point for Death Valley. I think we stayed in Lone Pine) Obviously this is harder with all the different places to stay but could allow you to do more / save you money.
We felt that time in Yosemite was much more worthwhile than in either SF or LA. And arguably its more child friendly.
From there its down to Death Valley and back to Las Vegas. Death Valley is absolutely amazing. But its a long road trip, and if memory serves, its short on places to overnight. I think you can but your options are limited. Plus you will not want to be out of the car long because of the temperatures. If memory serves we did Lone Pine to just after Death Valley in one of the small towns outside the park on the approach to Vegas.
Then we had a day in Vegas before flying home.
Ideally I think we'd have added more time at the start or end for Vegas to do the Grand Canyon. And I think you will want more time particularly around LA for various things.
I would say if you can stretch to 2 and a half weeks rather than two, do it. And keep in mind the distances for Yosemite and Death Valley section. Look at a map whilst planning this and look at drive times. It's definitely worth being organised for early starts too, before it gets busy on this section.
Have a wonderful time. It's a brilliant trip to do.