Yes, resetting your iPhone can remove spyware, but it also erases all data and settings. Make sure to back up your data before doing a reset.