There might be two reasons:
1 you have installed and runned APPs from unidentified developers or sources.
2 If you have rooted your phone, some malware can get the superuser authority and infect your device.
To get rid of the virus, you can take the following steps:
1 use anti-virus application
2 reset your phone
3 install a new ROM