One of the key elements of this novel is the absurdist philosophy that Meursault embraces. He finds increasingly that life has no sense of meaning or purpose and that the world is profoundly indifferent to human beings that do their best to live their lives and try and persuade themselves that there is some kind of order or benevolent god-like figure who takes care of them and protects them. The quote in this question comes from the end of the book, that describes how, once Meursault has been able to accept this absurdist philosophy, paradoxically, he is able to be happy:
Finding it so much like myself--so like a brother, really--I felt that I had been happy and that I was happy again. For everything to be consummated, for me to feel less alone, I had only to wish that there be a large crowd of spectators the day of my execution and that they greet me with cries of hate.
For Meursault, the story has tracked his movement from passivity to newly-acquired understanding of the absurd nature of the world. For him, his execution is the crowning moment of his new worldview and way of looking at the world. Through his execution he somehow feels that he will rise above those who cry at him with "hate" in their voice.