If an agency contacted me to create malware software, I'd refuse their business and tell them that it goes against my philosophy that software should be productive and not destructive to the user.
It is necessary to "touch evil" a little bit now and then to learn how to be good. Producing malware can in some ways help you better understand other more productive things later. What I'm not sure of is whether or not it is absolutely necessary to create malware to gain that knowledge. It may be that creating malware make you a better coder when it comes to script engines, it can make you a very clever designer of script engines simply by knowing smart infection techniques. That's one example. Personally, I wouldn't do malware.