The invention discloses an algal fungi synergistic ecological type microbial fuel cell and a method for generating electricity by utilizing water purification. The fuel cell consists of a fuel cell body, a water inlet distribution system, an anaerobic reaction area, a wetland ecological anode area and an algal fungi symbiotic cathode area. A cation exchange resin is added into a matrix, straw biological carbon is adopted in the wetland matrix, the conductivity is improved, and the internal resistance is reduced; an algal ecological cathode is constructed, and energy conservation and low carbon are realized; and moreover, a deep anaerobic zone is increased on the lower layer of the anode area and adapts to sewage feeding of high-concentration COD, the height of the cell body is increased, and the electrical activity of the cell is improved. The ecological wetland and the microbial fuel cell are combined, a wetland ecological anode and an algal fungi symbiotic oxygen-releasing ecological cathode are constructed, the ecological type microbial fuel cell is formed, and sewage treatment and energy recycling are realized.