The invention discloses a system and method for treating sewage at zero energy consumption by using an ecological filter bed. The system comprises a sewage pipe, a gravity water distribution system, the ecological filter bed and a water collecting system, wherein the sewage pipe is connected with the gravity water distribution system, the gravity water distribution system is arranged at the upper part of the ecological filter bed, and the water collecting system is arranged at the bottom of the ecological filter bed; the gravity water distribution system comprises a water inlet pipe, a water distribution pad, a water distributor and a supporting seat, wherein the section of the water distributor is inverted triangular, the inside of the water distributor is divided into two grids by using a partition plate, the water distributor is arranged on the supporting seat and can be freely turned towards two sides, the water inlet pipe is connected with the sewage pipe, and the other end of the water inlet pipe is arranged above the water distributor; and the ecological filter bed is composed of multistage infiltration layers sequentially including an impermeable layer, a water collecting layer, a composite infiltration layer, a biological treatment layer and a water distribution layer from bottom to top. The system is uniform in water distribution, strong in nitrogen and phosphorus removal capacity and good in water treatment quality, has the advantages of small floor area, simplicity in management and low operation cost and can realize sludge-free discharge.