The Mojave River Valley Museum, run by volunteers in a converted building downtown, punches above its weight for a small-city local museum. The collections cover the full sweep of the region: Native American artifacts from the Serrano and Chemehuevi peoples, fossil specimens from Rainbow Basin, exhibits on the old Spanish Trail and the role of the Mojave River as the only reliable water source in hundreds of miles of desert, and a section on the Route 66 era when Barstow was a genuine highway stop with motels, diners, and car culture.
The Desert Discovery Center next door (operated separately) focuses more on contemporary desert ecology and is worth pairing with the museum visit. Neither is large or particularly slick, but together they give you a grounded sense of the landscape you're driving through. Admission is free or low-cost.