How big a trailer and tow vehicle combo? It's been years since trying to reserve any sites except "off season" and the reservation system has changed and demand is insane, some sites are size limited, etc. Where you get or have a spot might suggest which route to take.
I live somewhat east of Los Angeles. When I lived in the Pasadena area, I'd allow 6 hours to get to Yosemite Valley. 2 hours to Bakersfield, 2 to Fresno, then 2 up 41 to the valley although you'd hit the Wawona/South entrance about an hour before getting to the Valley. Might vary depending on who was going, tolerance or desire for stops on the way. Trailer speed restrictions need at least some attention on the main highways and towing in the mountains will be slower than just driving a single vehicle. Longer to get to Lee Vining and Tioga Pass. Getting out of the L.A. Basin isn't all that direct to the east side of the Sierra. We had a tent trailer and pulled with a pick-up, enough power and light trailer, so not too difficult. I don't think you go over 4000 feet going in 140, 120 (the "north" west side route and 41 the "south" west side route will go over 6000 feet and a lot of curvy mountain driving. Entering/exiting 120 - Tioga Pass, you're going over 9000 feet and again, a lot of curvy mountain driving. Although there are some grades on 395, the worst mountain conditions are when you leave 395 at Lee Vining for 120.
Apple map shows Phoenix to Mojave (10 to 215 to 138 to 14) as about 6 hrs and 16 minutes. I think that's optimistic. Google showed 6 hrs and 43 minutes. Even that may be a bit optimistic. Both show something over 5 hours, Mojave to Yosemite Valley, either via 41 or 140. Maybe slower with a trailer, again. There are some RV parks in the Tehachapi area. No experience or recommendations but higher elevation and likely to be at least somewhat nicer than in Mojave.