Like all things - wars are a combination of rational self-interest, emotions and random chance.
The action itself matters less than the consequence. The typical example is that USA gets away with shit other countries can't because nobody wants to invade usa.
My understanding is that in this particular situation - yemen is a humanitarian disaster after their civil war. Any country that invades is going to be seen as responsible for fixing that mess, and nobody wants responsibility for that.
I think the other factor is that israel is not a popular country in most of the middle east. Even if these ship attacks screw over most of the countries in that region (probably hurting egypt more than anyone else) many of the regimes in the middle east dont have a super solid grip on power and are afraid to do anything that might be seen as helping Israel (even if really they are mostly helping themselves) lest it leads to popular discontent locally. Countries further away are less keen to get involved because middle east is a continual powder-keg that nobody really wants to get sucked into.
[Im definitely not an expert on this, just one uninformed opinion]