As long as it's not against company policy, it's probably not illegal. However if wearing it would give others the impression that you are a police officer, or other law enforcement official, then you could find yourself in trouble for impersonation. So unless there is a need to be wearing it, I'd just put it away when you aren't working.
It is not illegal, but it goes against the code of conduct. If you are to carry your badge off duty, then you have to carry it the way it should. You are also to have proper office attire for proper identification. You can refer to your rule book for more information.
I am wondering what chickenstip 'agency' isssued such a credential to a person who does NOT understand what and how the system works? Is this a private security company? Is this a security badge for your worK? If this is a Government agency, then YOU must have somehow slipped under the necessary education required to even HAVE a security badge, nevermind using one to impersonate an on duty person.
It's a security badge - not a law enforcement badge. Unless you're trying to dupe people or pretend your're somebody your not, that would not be advisable, Check with your employer. I'd be willing to bet they have a rule against such a practice.