There are different types of sentences on the basis of their functions and structure.
As in our speech we say different things vary in purpose,for example sometimes we make statements or ask questions or make request etc. So for every purpose different sentence structures are used.
For instance, imperative sentences are used to make request or command, declarative sentences are used for simple statements or deliver informations etc.