I can target a friendly portal and fire XMP or I can even do it in the middle of nowhere. Is there any benefit or reason to do so?
There is actually benefit... sometimes.
If you have 2000 items then you can no longer hack. To fix this you need to get rid of some of your items. There are a few ways to this:
So firing an XMP at nothing is a way to dispose of weapons that your team doesn't need without risking that the opposition might find them.
No, there is no benefit; you'll only waste the XMP Burster. Your own bursters will not damage resonators from your own faction either.
The reason you have the option available is because dropping a burster is in the quick access (hold and drag) menu and potential burster damage is calculated server-side after you fire.