Christians of the first centuries said, "The world was created for the sake of the Church." God created the world for the sake of communion with his divine life, a communion brought about by the "convocation" of men in Christ, and this "convocation" is the Church.And the Church is the primary means through which Christ gives us, by grace, the supreme gift of Himself, making us partakers of His own Divine Life. The Catechism here references the The Shepherd of Hermas (Vision 2, Ch. 4), a document of the early church written sometime in the 1st or 2nd century:
Now a revelation was given to me, my brethren, while I slept, by a young man of comely appearance, who said to me, "Who do you think that old woman is from whom you received the book?" And I said, "The Sibyl." "You are in a mistake," says he; "it is not the Sibyl." "Who is it then?" say I. And he said, "It is the Church." And I said to him, "Why then is she an old woman?" "Because," said he, "she was created first of all. On this account is she old. And for her sake was the world made."