This page contains all the information you could want, although it does contain some major spoilers (which even at a glance will be obvious).
Essentially, the opening non-spoilerific line from the page sums up the reason for the philosopher names:
[It] encourages viewers not only to appreciate the show as a
character-based drama, but to acknowledge the universal philosophical
questions that drove it.
From John Locke's wiki page:
Locke's theory of mind is often cited as the origin of modern
conceptions of identity and the self, figuring prominently in the work
of later philosophers such as Hume, Rousseau, and Kant. Locke was the
first to define the self through a continuity of consciousness. He
postulated that, at birth, the mind was a blank slate or tabula rasa.
There is an episode called Tabula Rasa in Season 1, but even if you haven't seen the whole series yet, you probably know enough of Locke's character to see that he is all about having a blank slate on the island - a fresh start, away from the previous life he had.
It's hard to answer this without spoiling the series for you, but suffice to say there are MANY references to philosophers, some very clear like with John Locke, others very cryptic leaving the viewer to guess at the philosopher intended (if any). There are some you've already seen, such as Thomas Carlyle (Boone) and Jean-Jacques Rousseau (Danielle).
Another interesting read (with spoilers as it identifies future characters) is found here. That link tries to explain the significance of the names in Lost beyond being mere philosophers - something which is quite useful, as once you look beyond just philosophy, you find many characters can be compared to real-life figures (e.g. Kate Austen compared to Jane Austen).