Let us remember that the lighthouse represents something of a place of refuge for John as he desperately struggles to hold on to his values and sanity in a world where there is so much pressure to give in to pleasure. Note what John finds attractive about the lighthouse in Chapter 18:
But it was not alone the distance that had attracted the Savage to his lighthouse; the near was as seductive as the far. The woods, the open stretches of heather and yellow gorse, the clumps of Scotch firs, the shining ponds with their overhanging birch trees, their water lilies, their beds of rushes--these were beautiful and, to an eye accustomed ot the aridities of the American desert, astonishing. And then the solitude! Whole days passed during which he never saw a human being.
We can see therefore that it was a combination of the beauty of nature and the solitude that John gained that caused him to go to the lighthouse. However, of course, as we know, this solitude was only temporary and fleeting, and the crowds that come lead to John's final giving in to the principles of pleasure and then his suicide.
I wonder whether we can find modern parallels in our society to the lighthouse in religious cults which seem to promise so much but actually often involve manipulation and blackmail. You might want to research into famous examples such as Waco or Jonestown. On a slightly different angle, you might want to consider the popularity of ashrams that promise release and isolation.