Your beer has become contaminated from either lack of proper hygiene, or by leaving the brew standing too long in the fermenter before bottling, or by oxidation (splashing the beer, causing it to come into contact with oxygen). Unfortunately there is nothing you can do about this problem.....tip it out!
Pay particular attention to cleaning and sterilising all your equipment and avoid removing the lid during fermentation.
Helpful hint :- unscrew the tap from the fermenter after each brew and thoroughly clean the tap hole. The tap hole threads are the ideal place for bacteria to harbour.