A series of hierarchically porous SrTiO3 films with different pore structure characteristics from bicontinuous macroporous–mesoporous structure to ordered and fragmented structures have been synthesized using sol–gel method, by controlling the competition between polyethylene glycol (PEG)-induced phase separation and sol–gel transition. Field emission scanning electron microscopy (FESEM), transmission electron microscopy (TEM), Brunauer–Emmett–Teller (BET) analysis, X-ray diffractometry (XRD) and photoluminescence (PL) spectroscopy were used to characterize the as-prepared samples. The bicontinuous structured SrTiO3 porous film constructed by irregular grains possessed three-dimensional (3D) interconnected network with both macropores (80–400 nm) and mesopores (1–10 nm), which provides abundant active sites (the specific surface area up to 121.9 m2/g) and ensures fast mass transfer simultaneously. In addition, PL spectra illustrated that the film consisting of 3D bicontinuous macroporous– and mesopores has a relatively low photocarrier recombination rate. As a result, the SrTiO3 film with 3D bicontinuous porous structure exhibits more outstanding photocatalytic behavior with high degradation capability for Rhodamine B (RhB) (99.8% after 90 min irradiation by 500 W mercury lamp) than the others. Moreover, nearly 80% of the degradation efficiency can be achieved after five cycles.