It wanted to stop the ship and deprive the flotilla of any PR/political gains. Hence the aggressive night time boarding in international waters. Didn't work, only served to enrage those on the ship leading to conflict and devastating result. Israel bungled it, the result so damaging that for a change the blood spilt by the IDF might not have been in vain.
ISIS claims responsibility for bombing in Baghdad suburb; death toll hits 21 (Reuters)
from the article: Straight into the trap