No, it is not possible to get legally married in the Maldives for foreigners. This is purely a ceremonial celebration. A renewal of wedding vows, or the first vows just before or after getting married in your home country.