Polyimide foam (PIF) is a rising star in high-end applications such as aerospace thermal insulation and military sound absorption. However, the basic rule on molecular backbone design and uniform pore formation of PIF still need to be explored. In this work, polyester ammonium salt (PEAS) precursor powders are synthesized between alcoholysis ester of 3, 3′, 4, 4′-benzophenone tetracarboxylic dianhydride (BTDE) and aromatic diamines with different chain flexibility and conformation symmetry. Then, a standard “stepwise heating” thermo-foaming approach is used to prepare PIF with comprehensive properties. A rational thermo-foaming program is designed based on in situ observation of pore formation during heating. The fabricated PIFs have uniform pore structure, and PIFBTDA-PDAshows the smallest size (147 μm) and narrow distribution. Interestingly, PIFBTDA-PDAalso presents a balanced strain recovery rate (SR = 91%) and mechanical robustness (0.051 MPa at 25% strain) and its pore structure maintains regularity after 10 compression–recovery cycles, mainly due to high rigidity of the chains. Furthermore, all the PIFs possess lightweight feature (15–20 kg∙m−3), good heat resistance (Tgat 270–340 °C), thermal stability (T5%at 480–530 °C), thermal insulation properties (λ = 0.046–0.053 W∙m−1K−1at 20 °C, λ = 0.078–0.089 W∙m−1K−1at 200 °C), and excellent flame retardancy (LOI > 40%). The reported monomer-mediated pore-structure control strategy can provide guidelines for the preparation of high-performance PIF and its industrial applications.