UBL was no friend to the Iranians, so it may have been them that sold him out in the end.
The Iranians ratting him out makes sense. If the Iranians sold UBL out, to whom and for what...?