Sometimes it is necessary to run an application with root permissions in order to do some elevated work like binding to ports lower than 1024 or writing to files in /var/log, etc. After the elevated work is finished, it is good practice to drop the root privileges and continue with the execution path as a non-privileged user. The motivation is based on security reasons: if ever an attacker takes control over your application, it should not give him control over the whole system.