One of the major arguments for scientific realism is that the best explanation for why our best scientific theories are predictively successful is that they are literally true or at least literally approximately true. After all, wouldn't it be incredible if things behaved observationally as if the theories were true, but the theories weren't true?
While this is a pretty good argument, it's worth noting that theists have an alternate explanation: In order that intelligent beings be able to make successful predictions of a sort that lets them exhibit appropriate stewardship over the world, God makes the world exhibit patterns of the sort that human science is capable of finding, patterns that can be subsumed under theories that are sufficiently simple for us to find. And one sort of pattern is of the as-if sort: things behave as if there were photons, which lets us organize the behavior of macroscopic things into patterns by supposing (in a way that need not carry ontological commitment) photons.
That said, there is a value to science over and beyond its helping us exercise stewardship over the world—understanding of the world is valuable for its own sake—so even given theism, a scientifically realist theistic explanation seems better than a scientifically non-realist one.
But even if realism is in general the right policy, maybe theism could provide a tenable Plan B if there turn out to be cases where scientific realism is not tenable. For instance, one might think (incorrectly, I suspect) that there is no metaphysically tenable and scientifically plausible version of quantum mechanics. Then, one might retreat to a theistic explanation of why the world behaves as if the metaphysically untenable theory were true. Or one might think (because of Zeno's paradoxes, say) that it is impossible for spacetime to be adequately modeled by a manifold of the sort that mathematics studies (one locally homeomorphic to a power of the real number line). But why do things behave as if spacetime were such a manifold? Maybe God made them behave so because this lets us organize the world in convenient ways.