What is the need of plugins in Jenkins (Sonarqube)
Any CI/CD plugin can ultimately be scripted.  However, using plugins gives you better centralized control.  

Consider the following scenario: Your SonarQube server location has to move to a new location.  

If you are using a script like the example you provided above, you would need to manually update every script.  This process is error prone as you may miss a script or worse, type the wrong address.  Instead, if you are using a plugin you can update the server location once and be done.