They ceased to be a legitimate federal agency the day they were moved out of the Internal Revenue office, 1 July 1972, and even then only the collection of the taxes on alcohol and tobacco were legitimate. Those functions stayed with Treasury when BATFE was recentely moved to Justice and was renamed. Either taxing or restricting the right of the people to keep and bear arms is an infringement of that right, prohibited by the Second Amendment, and thus illegitimate.
That's not to say that they don't have few other legitimate or at least worthwhile functions, such as providing expertise on arson and explosives. Those functions properly belong in other agencies, such as the FBI.
The BATF(E)'s abuses did not start with Waco. Part of the reason the Firearms' Owners Protection Act was enacted during the Reagan adminsitration was to reign in the BATF, and eliminate or modify some of the laws they were abusing.