Spectropolarimetric Inversion in Four Dimensions with Deep Learning (SPIn4D): II. A Physics-Informed Machine Learning Method for 3D Solar Photosphere Reconstruction