To answer your question, the reason William Golding used British schoolboys in his novel was that Golding himself was educated in England at an all-boys school. His father was the Science Master at Marlborough Grammar School where Golding and his brother were educated. At the time, it was a boys-only school. Golding, like many famous writers, used what he knew to provide the background for his stories. Because of his boyhood, he would have recognized and understood the social circles and politics involved in an all-boys school.
Golding went on to become an educator at Bishop Wordsworth's School. This school is a private school for boys run through the Church of England. His experiences teaching at this school helped develop the structure that the boys use when they are described at the beginning of the story, specifically the choirboys. Because Golding never participated in a coeducational environment, he had no knowledge of how schoolgirls behave, personally (he only had a brother) and socially. The easier background for his story would use the social dynamics about which he was knowledgeable.
William Golding has an interesting video on TedEd, where he speaks about writing Lord of the Flies. It runs only three minutes. Specifically, he makes the comment that the reason he wrote the story about a bunch of boys is because first, he does not know what it is like to be a girl, and second, he said that boys behave more like society in general. I am including the William Golding commentary in the reference links below. Hearing Golding himself talk about the inspiration for the book provides wonderful insight into this classic novel.