Polyimide (PI) foams possess excellent mechanical properties, high-temperature resistance, and other unique properties, which facilitate impact in aerospace, automotive, and microelectronics industries. However, when they are used as lightweight insulation structural layers for high-temperature carbon fiber reinforced composites, improvement in thermal-insulating properties and temperature resistance of PI foams without compromising the flexibility in extreme environments is a challenging task. In this study, the flexible blocks were linked into rigid polymeric structures to fabricate a thermoplastic structure through a simple aqueous strategy to construct hydrogen-bonding networks. Thus, with a low shrinkage of 8.42%, an ultrahigh compressive modulus of 11.17 MPa, and a specific modulus of 81.03 MPa cm3 g−1 was successfully achieved. Benefitting from the formation of ultra-strong network backbones, foams showed excellent thermal-insulating properties and temperature resistance. The robust porous material with thermal-insulating properties (0.0481 W m−1 K−1) exhibited a compression modulus of 4.21 MPa after heat treatment at 300 °C and maintained 91% strength retention, thus it can be used as lightweight heat-insulation composite sandwich structures up to 300 °C. The copolymer foam obtained by using 30 mol% flexible blocks reserves its high flexibility undergoing only 10% dimensional changes after 40,000 compression-release cycles. The lightweight thermoplastic PI foams with flexibility, thermal-insulating properties, and temperature resistance can be used for high-temperature lightweight composite sandwich structures in aeronautics and space exploration.