Chagrin:
It's the inductive spike from the relay coils that you're isolating from. I'll agree that the inductive spike is usually not a problem (as long as the module is properly designed with a flyback diode -- and it is); I'm just trying to set the record straight. OP never provided any detail about his project that would let us know if the optical isolation was appropriate or not.The "VCC" pin on the relay module is only providing current to the LED side of the optocouplers. The "JD-VCC" pin is providing current to the transistor, optocoupler phototransistor, and the relay coils. There is appropriate isolation in that respect.
Thanks for the clarification. There's no current project, but lets assume I might need optical isolation in the future. About the common GND, I was writting a small "how to" for future reference, and it was more intuitive to describe the wiring for the optical isolation mode as the normal wiring plus some other pins. I've now changed that and will keep Arduino's GND not connected. But I still don't really understand why it can be bad. Maybe because if the module breaks it might inject a reverse current through the Arduino's GND?
Other than this, my only doubt now is about the setup code, which I found in the link you posted I think:
digitalWrite(relay_pin, 1);
pinMode(relay_pin, OUTPUT);
Why the internal pullup? Is it needed for this module?