We can't really know for sure what Shakespeare's intentions were in writing any of his plays. However, there is speculation that The Tempest was his "swan-song," his farewell to the world of theatre. Many consider the character of Prospero to be a bit like Shakespeare himself, and when Prospero gives up his magic at the end of the play, it is Shakespeare's way of giving up his own magic as a playwright. Many scholars believe that The Tempest was the last play he wrote by himself, but that he collaborated on others, helping up and coming playwrights hone their skills before he retired and went back to Stratford-Upon-Avon.
Check the link below for more information about this play!