We don't know the exact origins of the Flood. A ship from outside the galaxy was found with dormant Flood. There was some basic experimentation done and no one realized the threat until it was out of control. It could have been a Precursor biological weapon sent against the Forerunners, but it isn't clear.
IN THE GAME HALO ANNIVERSARY 15 NOV 2011 THERE IS A VIDEO WHERE IT SHOWS GUILTY SPARK OBSERVING A FLOOD SPORE IN A TEST TUBE,IN THE VIDEO IT ALSO SAYS THAT THE FLOOD WHERE MADE TO DESTROY EVERY LIVING THING IN THE UNIVERSE. THE FORERUNNERS MADE THE FLOOD AND THE COVENANT UNLEASHED IT.
Like he alisema there is no story to how the flood were created but also like he alisema the experimented on them thus freeing them from thier being trapped on a planet with no means of escaping the flood fought the forerunners "infecting" one of the ships which was doomed to float about in space untill they were than forsed to be stranded on Halo were they were once again trapped untill the covenant and the humans came along and relised once again now they are intent on killing everyone and stoping the rings from firing. I will leave the details for wewe to find out while playing the game.