While the smell of corals is a combination of chemicals (coral reefs are a chemical smorgasbord after all), what you’re predominately smelling is a sulfurous compound called dimethylsulfoniopropionate, or DMS for short. That is why out-of-water Acropora give off an odor reminiscent of faint rotten eggs.
Corals and Symbiodinium produce DMS (lots of it!) to protect themselves from oxidative stress that can occur when corals are out of water. When corals are directly being bombarded by strong tropical sunlight, increased photosynthesis can create dangerously high levels of oxygen … especially with no moving fluids (seawater) to help with the buildup. The DMS induces photoinhibition, the reduction of photosynthesis. At the same time, DMS scavenge harmful hydroxyl radicals and other reactive oxygen species that can harm coral cells. Essentially, that funny odor you smell is protecting the coral from chemically burning itself.
Now you know what that smell is.