Well, things are what they are, and they ain't what they ain't. This poem is NOT engraved on the Statue of Liberty, and it had nothing to do with the statue's origin. The poem is on a plaque that was donated by a private individual about 20 years after the Statue of Liberty was erected.
The plaque with the poem is on the statue's pedestal, not on the statue itself. How it got there isn't clear; it wasn't the result of any official government action. The poem wasn't popular in its time nor was it representative of the views of anyone other than the anonymous private individual(s) who placed it there.
It wasn't until about forty years later that (a) the poem and (b) the Statue and (c) immigration were somehow "tied together" by enthusiasts of mass immigration. They wanted a symbol to strengthen their cause. If you repeat something enough times, people will believe it.
The true name of the Statue is "Liberty Enlightening the World," NOT "Liberty Inviting the World."