The closest airport to Joshua Tree National Park is PSP which is about 40 miles away; ONT is about 95 miles, LAX 145, SAN 160, LAS 180, PHX 225 and SFO 500.
If you are looking for a scenic route, consider going from San Diego to Joshua Tree NP via
Anza-Borrego Desert State Park and the Salton Sea; the driving distance, not including visiting those locations, is a bit more than 170 miles.