"Is BadUSB considered a software?"
Of course it is.
"is freedom 0 appliable to harmful uses?"
Of course it does. It might be malware, running a nuclear reactor, the
scheduling system for an abortion clinic, the guidance system on a cruise
missile, or whatever else you can imagine. Software freedom is for everyone,
so anything that anyone wants to do with a computer should be doable while
keeping their software freedom. So "for any purpose" must literally mean "for
any purpose" - even for the purposes that someone else might not like.