Ionic liquids (ILs) have been often incorporated into metal–organic framework (MOF) to improve the performance of gas adsorption and separation. However, ILs are prone to agglomerate in the pores of MOFs, which causes insufficient exposure of their active sites, thus significantly reducing the separation efficiency. Herein, we report a zwitterionic MOF UiO-66-SO3−-NH3+ with both positive and negative charges for enhanced ILs dispersion and CO2 capture. When the ILs were introduced into UiO-66-SO3−-NH3+, they can be highly dispersed in the pores of MOF through the electronic interaction between positive and negative charges of MOF and anion and cation of ILs, and the active sites of IL can be adequately exposed. Notably, this is the first report of IL@zwitterionic MOF composites for CO2 capture. Compared with the single group modified counterparts, namely IL@UiO-66-NH2 and IL@UiO-66-SO3H, IL@UiO-66-SO3−-NH3+ exhibits higher CO2 affinity, which increases its CO2 adsorption capacity by 36–45%. Moreover, the CO2/N2 and CO2/CH4 adsorption selectivities of UiO-66-SO3−-NH3+ are 3.6–5.0 times and 2.1–2.5 times higher than that of single-group modified counterparts, respectively. This work not only provides a method to realize the high dispersion of ILs in MOF via constructing the zwitterionic MOF, but also reports an excellent adsorbent for CO2 capture.