Spatial transcriptomics (ST) technologies are revolutionizing the way that researchers explore the spatial architecture of tissues. Currently, ST data analysis is often restricted to 2D space within a single tissue slice, limiting our capacity to understand biological processes that take place in 3D space. Here, we present STitch3D, a unified computational framework that integrates multiple 2D tissue slices to reconstruct 3D cellular structures from the tissue level to the whole organism level. By jointly modeling multiple 2D tissue slices and integrating them with cell-type-specific expression profiles derived from single-cell RNA-sequencing data, STitch3D simultaneously identifies 3D spatial regions with coherent gene expression levels and reveals 3D distributions of cell types. STitch3D distinguishes biological variation among slices from batch effects, and effectively borrows shared information across slices to assemble powerful 3D models of tissues. Through comprehensive experiments using diverse datasets, we demonstrate the performance of STitch3D in building comprehensive 3D tissue architectures of the mouse brain, the human heart, and the Drosophila embryo, which allow 3D analysis in the entire tissue region or even the whole organism. To gain deeper biological insights, the outputs of STitch3D can be used for downstream tasks, such as inference of spatial trajectories, identification of spatially variable genes enriched in tissue regions or subregions, denoising or imputation of spatial gene expressions, as well as generation of virtual tissue slices.