How do you know a programme did this? Whether its legal or not depends, if it was software that you installed and it stated in the terms and conditions that it will place such a programme on your computer, then there's nothing you can do about it if you installed it accepting those terms and conditions.
If the programme was put on maliciously by a person its up to you to prove they did it, its not up to them to prove they are Innocent. If the programme came over the Internet then it will be virtually impossible for you to prove who did it.
Just delete the programme and be more aware and make sure your security software and firewall is up to date.