There are many safeguards built into modern ship's electrical systems. If they are all working properly, we are safe. But as anyone who cruises frequently can tell you, cruise ship equipment and systems quite frequently experience problems and do not operate as designed, hoped, and planned.
The recent Carnival fire off the Mexican coast is a very good example of an electrical system going wrong.
Rather than tempt fate, we try to err on the side of caution and keep all our passengers alive.