Your interpretation in indeed correct. In fact, the Treatise Concerning the Principles of Human Knowledge as a whole can be seen as a sustained refutation of atheism, which Berkeley, a bishop in the Church of Ireland, regards as an incredibly pernicious and dangerous idea.
In the above paragraphs, Berkeley argues that a belief in the existence of matter has been a support for atheism and all other kinds of irreligion since time immemorial. Even the most celebrated ancient philosophers, even those who accepted the existence of some kind of divine being, thought that matter was uncreated and coexisted with the deity. Yet they failed to realize that by advocating such a materialist philosophy, they were undermining the very foundations of theism as traditionally conceived.
Berkeley holds that matter is the foundation stone of atheism; atheism simply cannot exist without a belief in the existence of matter. Take away matter, then, and you have no atheism. So, Berkeley, as a staunch theist, attempts in the Treatise to refute atheism by disproving the very existence of matter.
But in paragraphs 91 to 96—the remaining four paragraphs represent an attack on the notion of abstract ideas—Berkeley isn't engaged in refuting atheism so much as showing that it is supported by a belief in the existence of matter. If matter were removed from the picture, if it were "expelled from out of Nature," to use Berkeley's words, then all kinds of skeptical, heretical, and impious notions would go with it. And this is precisely what Berkeley attempts to do throughout the Treatise.