Rooting Samsung Galaxy S5 is completely legal, but many manufacturers lose your warranty if you send a geroote smartphone for repair. So send yours are Galaxy Nexus to Samsung because of a broken SIM card tray, and the repair was not compensated because the smartphone was rooted. Samsung sent me a photo of the Superuser app as evidence. It is of course possible to install the stock firmware without root before you send your phone in for repair.
In addition, most Android updates no longer work. The update system detects that the device has root access, making the update process is not always carried out. Some root-apps have the ability to unrooten the unit temporarily, so that manages the update process. But many complain after this that they need to install root again.