The energy delivered by a solar panel is overwhelmingly more than needed to make it. The gain is enormous. There is simply no contest.
Consider that makers of solar panels, and of the materials that go into them, get no break on their power bills. Each and every kWh that goes into making the panel is paid for, and necessarily has its cost folded into the price of the panel. Otherwise they would be paying power out of their own pocket, to give it to you for free.
Furthermore, the fraction of the energy used in making the panel that comes from renewables goes up every year, as their share of the total generated increases.
The same argument applies to wind turbines, tidal turbines, wave engines, dams, and (in their way) storage media.