In fact, the technology already exists today. It is called gene drive.
Essentially, a gene drive causes a specific version of a gene (an allele) to always be passed on to offspring. Normally random choice gives each allele only a 50% chance of being passed on. This means that a gene drive allele will spread incredibly rapidly through any population it is introduced to. Current research is focusing on eliminating mosquitoes by making a gene drive allele that is harmless with one copy (heterozygote), but lethal with two copies (homozygote). When a wild mosquito mates with a heterozygote all of the resulting offspring will be heterozygotes. Eventually the entire population will be heterozygotes. When two heterozygotes mate their offspring will all be homozygotes and will die. Thus the entire population will be rendered infertile.
Your idea of an all male population can be achieved by making the homozygotes only die when female, but not when male. In theory this would improve the approach by maximizing the spread of the gene drive allele.
As far as environmental effects go all research I have seen on the subject suggests the extinction of mosquitoes would have only a minimal effect on the ecosystem. This technology and in fact these mosquitoes exist today. The main obstacle to their use is the unstoppable nature of the gene drive. Any unforeseen consequences would be irreversible.