Actually, it's quite a good idea to utilize the gas potential of sewage. As mentioned in Sherwood's answer, this will happen at the treatment plant, not in the sewer.
Edit to add
I wrote the part below without real wastewater experience. Now that I have some: A common way is the following: seperate primary sludge and fats in a settler, these go directly into anaerobic digestion. The aerobictreatment of the remaining wastewater with the activated sludge process produces waste sludge, this also goes into the digester. Expect about 18 l/day PE sewage gas at ~60% methane. This can provide a significant part of a sewage plants power consumption, but not more.
End Edit
The ways to do this are not trivial, but doable. Look at the wikipedia page for anaerobic digestion for an overview. The biggest challenge in AD of sewage is that sewage is highly diluted, with lots of water. So you need different concepts than with a anaerobic digester handling manure, or foodwastes or energy crops. But, as I said, it's doable.
While the energy generated maybe small potatoes compared to the energy demand of the population supplying the sewage, it can be significant for the treatment plant. There's also another benefit, less obvious: In traditional wastewater treatment, a large step is the aerobic degradation of the organic contents, by bacteria. Aerobic bacteria can gain far more energy from the matter than anaerobic species, so they grow far faster. The sludge from aerobic digesters is mostly made up of the 'excess' bacteria. Sludge treatment and disposal is a major cost in treatment plants. Anaerobic digesters produce far less sludge. As an example, upflow anaerobic sludge blanket reactors are said to ...
With UASB, the whole process of settlement and digestion occurs in one or more large tank(s). Only the post UASB liquids, which have a much reduced BOD concentration, needs to be aerated.
This leads to a halving of the aeration energy and doubling of the power generated from digestion
If you are interested in the technical challenges, I advise you to look at the most excellent and free book Anaerobic Digestion (and maybe skim the other free IWA titles)
I can't answer why AD is not the standard treatment for wastewater. My guess is that many treatment plants in the developed world where built before the AD technolgoy was mature, and it's a huge headache to change a plant to a completly different process. Apparently, UASB seem to be far more common in Brazil.