It looks like a guard crab, a species of crab that lives on and around the coral to defend it from predators in return for a home and food. Some people even think that their movement around the coral increases water circulation to the deeper reaches of the colony ultimately making it a healthier colony. Its a shame you threw it out, next time if you're unsure about a hitch hiker put it in the sump, ask around, and then if it turns out to be a baddie leave it in the sump or find a new home for it, I think a lot of folks here do the same. There's even a few threads on here where people have named and bonded with their "monster" in the sump lol