The development of functional carbon materials using waste biomass as raw materials is one of the research hotspots of lithium-sulfur batteries in recent years. In this work, used a natural high-quality carbon source—coffee grounds, which contain more than 58% carbon and less than 1% ash. Honeycomb-like S and N dual-doped graded porous carbon (SNHPC) was successfully prepared by hydrothermal carbonization and chemical activation, and the amount of thiourea used in the activation process was investigated. The prepared SNHPC showed excellent electrochemical energy storage characteristics. For example, SNHPC-2 has a large pore volume (1.85 cm3·g− 1), a high mesoporous ratio (36.76%), and a synergistic effect (S, N interaction). As the cathode material of lithium-sulfur batteries, SNHPC-2/S (sulfur content is 71.61%) has the highest specific capacity. Its initial discharge-specific capacity at 0.2 C is 1106.7 mAh·g−1, and its discharge-specific capacity after 200 cycles is still as high as 636.5 mAh·g−1.