Most sewage ends up either in a septic system or in a sewage treatment plant.
In either case, bacteria process the organic waste and decompose it, and at the same time decompose the cellulose fibers that make up toilet paper. And these bacteria release carbon dioxide as a byproduct–and that’s a greenhouse gas.
On the other hand, in landfills, once the oxygen is gone, garbage-eating bacteria take over that don’t require oxygen. But this process produces methane, which has about twenty times more global warming potential than carbon dioxide.
So, from this perspective, it’s clearly better to flush.
Sewage Treatment Plants
Except that many sewage treatment plants use a similar process to degrade the solids that settle out of the wastewater. And because degradation happens faster in moist environments, this process may actually release more methane compared to landfills, where moisture is limited to avoid contaminating ground water.
So it isn’t really clear whether landfills or sewage treatment plants release more harmful gasses. In the end, however, flushing is way more sanitary than carting used toilet paper to the local landfill.