The attack shocked the country on the Mediterranean coast, one of the world’s smallest sovereign states known for its high concentration of ultra-wealthy residents.