To get rid of spyware simply reset the iPhone as shown in this article but skip the backup process completely. Instead take backup of some specific & important things. Now factory reset iPhone without & erase everything. Now can transfer your important stuff back to your iPhone.