Mesoscale simulation was performed to investigate the dynamical structural behavior of the pluronic P123 block copolymer in the synthesis of mesoporous SBA-15. Shear is introduced to represent stirring in the actual experiment, and a weak charge is included to simulate the acidic conditions in the synthesis. Under shear, with the increase in weak charge in the PEO [poly(ethylene oxide)] block, the template forms more ordered hexagonal phases, and the pore sizes of the cylindrical hydrophobic PPO [poly(propylene oxide)] blocks decrease. The structural factor shows three types of water molecules in the mesoscale aggregates, including bulk water in the solution, bound water around the hydrophilic PEO corona, and trapped water in the hydrophobic PPO core. When 1,3,5-trimethyl-benzene (TMB) is added to the system as a swelling agent, expanded hexagonal phases are formed, and the density mapping of TMB shows that the TMB molecules are mainly located in the hydrophobic PPO cores. In configurations with spherical micelles, although bimodally dispersed spheres are observed, the face-centered cubic (fcc) packing of the micelles hardly changes with the addition of TMB. In agreement with experimental results, the simulations show that the shear and the weak charge are essential to the formation of hexagonal templates in the copolymer. Mesoscopic simulations complement experimental investigations on the morphology changes of amphiphilic polymer in template syntheses and can provide important guidance for further experiments.