Well, your phone may not have been jailbroken, but it is now. Checking what you reported here, flexispy.***/en/spy-on-iphone-compatibility.htm shows that it requires the person that installed it to have possession of your device and the phone has to be jailbroken to install.
As always, it is not possible to install anything that is not in the App Store on an iOS device unless the device has been jailbroken.
<Link Edited by Host>