Flame retardants play a crucial role in improving the flame retardant properties of polymer materials. In recent years, environmental problems caused by flame retardants have attracted widespread attention. It is urgent to use green and effective methods to prepare flame retardant polymers. Bioinspired nanocomposites with layered structures seem to provide an effective idea, but in general, the hydrophilic properties of their raw materials limit their applications in certain fields. Here, we prepared biomimetic composites with a layered “brick-and-mortar” structure by gravity-induced deposition using polyimide as the polymer matrix and montmorillonite (MMT) as the filler. The well-arranged structures of the composite material could isolate oxygen and prevent combustible gases from escaping. The gas barrier performance has been greatly improved, in which the water vapor transmission rate (WVTR) and the oxygen transmission rate (OTR) decreased by 99.18% and three orders of magnitude, respectively. The flame retardant performance has also been improved, and its limiting oxygen index can reach 67.9%. More importantly, the polyimide matrix can be converted to water-insoluble by thermal imidization of water-soluble poly (amic acid) salt precursors, which endows the composites with low hygroscopicity. Such coating containing MMT can protect against polyurethane (PU) foam from fire. During the conical calorimetric test, the coated sample self-extinguished, and the peak heat release rate, total heat release, total smoke production is significantly decreased by 53.39%, 40.69%, and 53.03%, respectively. Taking advantage of these properties, this work utilizes a facile method to prepare biomimetic composites with low moisture absorption, excellent gas barrier properties, and flame retardancy, which have great application potential.