The moral aim of the poem “The rape of the lock” is to show the folly of pride and selfishness.
Alexander Pope, the author of the poem, mocks the 18th-century society via satire and ridiculous portraits of people who are considered ‘heroes.’
Moreover, he mocks even the structure of the poem, by taking the classical epic poems of Virgil, Homer, Milton, etc. as a basis for own fiction. He tries to parody the structure in own verse, thus ridiculing the heroic couplets of the past.
The aim of the whole thing as for me is to show the confused values of the society he lives in. Poets and writers are well-known for analyzing society and showing the ugliest flaws of it in own pieces. There is a widespread belief that such an approach would help the society by making it reflect the issues it is up to and consider the overall situation.
Sure, it would be cool if those art pieces would move and change the whole society. Still, usually, it is only about several people, who are willing to consider and think. They look for literature like that, analyze it and build own worldview upon it.
When reading the poem, keep in mind it was written in the 18th century (published in 1712), and it was about the 18th century. It also contains a high percentage of absurdity, and the plot might seem a bit insane to you. Right now it can be hard to uncover all the symbolism, but most surely it was kinda apparent in the times of the author's life.