The “polysulfide shuttle,” a process initiated by the dissolution of polysulfides, is recognized to be one of the major failure mechanisms of lithium–sulfur (Li–S) batteries. Much research effort has been dedicated toward efficient cathode additives and host materials to suppress the leaching of polysulfide species. Herein, we report a new 2D metal–organic framework constituted by a tritopic ligand, boron imidazolate ([BH(Im)3]−, Im = imidazole), and Co2+ ions for lithium polysulfide adsorption. The cobalt imidazolate framework (CoN6-BIF) contains octahedrally coordinated Co centers that form two-dimensional layers in the a,b plane. Composite cathodes containing CoN6-BIF exhibited high sulfur utilization and capacity retention, resulting in improved specific capacity and cycle life compared to sulfur/carbon controls. Density functional theory (DFT) calculations suggest that CoN6-BIF linkers are rotationally flexible, allowing the framework to accommodate polysulfide in the expanded pores. This unusual property of BIFs opens up new avenues for exploring flexible metal–organic frameworks (MOFs) and their applications to energy storage.