Manipulating the molecular aggregation behavior plays an important role in many fields. Here, by manipulating the molecular aggregation behavior, it is the first time that the same benzoxazine molecule is used to synthesize two kinds of gel materials with underwater superoleophobic and underoil superhydrophobic properties. Meanwhile, these materials are successfully used to separate surfactant‐stabilized water‐in‐oil and oil‐in‐water emulsions. The relationship between the surface properties and molecular aggregation behavior is analyzed. Controlling molecular aggregation behavior is essential to allow the molecules reach the most stable state spontaneously (where the Gibbs free energy is the smallest under constant temperature and pressure) under different environmental conditions. This research may open a new pathway to construct different functional materials by using the same molecule, and also provide a basis for other fields to achieve various applications by manipulating the molecular aggregation behaviors.