Ergoregion instability of exotic compact objects: Electromagnetic and gravitational perturbations and the role of absorption