Here's an idea:
So we know that the Flood absorb the intelligence and memories of those infected from Halo: The Flood, and that they can be turned into a collective intelligence (Keyes Blob, Gravemind).
So imagine the Forerunner trying a plan against the Flood. One fallen soldier would mean the element of surprise is gone; their entire plan is foiled. It's obvious the Flood spread much faster than can be contained, so imagine that the Flood has spread to many worlds, enslaving entire species. Each of those infected seek out others to infect. Sure the Forerunner try to stop them, but they're spreading much, much faster than they can contain them, even with other populations joining the fight against the Flood.
The Flood could have captured Forerunner ships and gone and created their own ships. We all know they can repair ships (opening of Keyes, on Halo), so it wouldn't be that much of a jump to think that a Forerunner could have been infected and given the Flood intelligence the knowledge on how to build a ship, how to best exploit Forerunner weaknesses, where the most populations and viable Flood hosts are, and again, their secret plans.
So after the Halos were built to look for a way to fight the Flood and stop its spread, the only conclusion is that the Flood would starve if no more food was present. Instead of glassing worlds one by one and leaving the planet uninhabitable, and attempting to stop the Flood by conventional means, they decide to build this weapon of last resort.
They're fighting a losing battle. The Flood is spreading much faster through the galaxy than the Forerunner can shoot down their ships. With every fallen species, new intelligence and technology is absorbed into the Flood intelligence. There are still a few civilizations left out of the way of the Flood infestation (Earth, Onyx), so they build devices to protect them from the Halo pulse.
They're thinking is that all civilizations will fall to the Flood, and after that, the Flood will starve. The Forerunner know that the entire galaxy could be devoid of life before they stop the Flood (and if). After the Flood finds no more populations, it will then starve. Leaving the galaxy without life, worlds uninhabitable, destruction on a galactic scale. It's this reasoning the Forerunner use. They might as well stop the destruction and infestation, save the civilizations that they can (Covenant, Humanity), and let life restart.
I completely agree with Endejas. Saying the Forunners didnt think everything out is purely assumption. We really dont know the extent of the Forunners Empire. It may have spread the span of several galaxies, and the Milly Way is just one that they lost to the Flood. They were outnumbered an were losing an basically took them an the Flood out. There have been many instances in the novels where Human controlled vessels out gunned or heavily damaged would self destruct to take Covenant ships with them. If you say the Forunners had alternative options, then you also probably think that the plight of a crippled Human vessel has an alternative to self-destruction, but in both cases the fight is to the death, and if you're going to die chances are you'll want to take any enemy you can with you.