In the bulk, LaCoO3 (LCO) is a paramagnet, yet in tensile-strained thin films at low temperature ferromagnetism (FM) is observed, and its origin remains unresolved. Polarized neutron reflectometry (PNR) is a powerful tool to determine the depth profiles of the structure and magnetization simultaneously and, thus, the evolution of the interfacial FM with strain can be accurately revealed. Here, we quantitatively measured the distribution of atomic density and magnetization in LCO films by PNR and found that the LCO layers near the heterointerfaces exhibit a reduced magnetization but an enhanced atomic density, whereas the film's interior (i.e., its bulk) shows the opposite trend. We attribute the nonuniformity to the symmetry mismatch at the interface, which induces a structural distortion related to the ferroelasticity of LCO. This assertion is tested by systematic application of hydrostatic pressure during the PNR experiments.The magnetization can be directly controlled at a rate of -20.4% per GPa. These results provide unique insights into mechanisms driving FM in strained LCO films while offering a tantalizing observation that tunable deformation of the CoO6 octahedra in combination with the ferroelastic order parameter.