This is a quote about the need for people to stand up against injustice, even when it is not directed at them. Niemoller is saying that he and others like him were complicit in the Holocaust because they did not stand up and oppose the Nazi government when it started to take people away based on thier political beliefs or, later, because of their religion.
One thing that is interesting to note about this is that it is really not a statement based on morality. Niemoller may have morality in mind, but he does not use any appeals to morality in this famous quote. Instead, the reason he gives for standing up for others is that, if you don't, no one will stand up for you. This is an appeal based on self-interest rather than an appeal based on the idea that it is simply right to stand up for justice.