The gender of the book often has something to do with the main character, but not always. If you've read Gaiman's Stardust, he says that he considers the book to be female, even though the main character and hero of the book is male. Coraline is a female book too, in his mind, whereas Neverwhere is male.
So it's not necessarily to do with the type of book - a book for girls, or a book for boys, or to do with the protagonist, the gender of the main character. Reading on in his essay it became clear that even a book with a male protagonist could be female. Partly it's to do with whether Gaiman considers that it is the male or female character(s) who have been assigned greater depth and complexity, or whether they behave, and are described in much more "stock" terms.
I've read and enjoyed both The Graveyard Book and The Ocean at the End of the Lane. Both books feature a male protagonist. In The Graveyard Book - it's Nobody Owens, Bod, with Silas as his ghostly guardian; so is the book male? And in The Ocean at the End of the Lane - the main character is a man who returns to where he grew up for a funeral and while he's there he walks the path back to a farm at the end of the lane and a significant time in his childhood. He remains unnamed, unlike his best friend, Lettie Hempstock, her mother and grandmother, and the evil Ursula, who threatens to destroy him. The female characters are very strong, central and pivotal to the book. So I'm guessing the book is female...
When I write I don't think: 'I'm writing a book for girls', or 'I'm writing a book for boys'; nor do I mentally assign a book a gender, or really even think about it in those terms. When I think about the books I've read, I don't think of them as possessing a gender as such either, or possessing characteristics you might associate with a particular gender.
In The Long Weekend, about two boys who are abducted by a monster, I would in Gaiman's terms see it as being male. But that's probably because apart from a mother and sister being referred to by the main character, there are no female characters in the book. This is in hindsight and not how I would ever see any books I've written. Also, I don't think Gaiman is saying that specific books would appeal only to a specific gender.
It's a different way of looking at writing, at how you write, and how you envisage the book you're writing. It works for Gaiman, but it doesn't work for me, and it might or might not work for you. It's like how you start a book. For Gaiman it's never about the blank page. It's about the opening or the character, or a scene, images, location, and an idea of how these all come together.
Where I wholeheartedly agree with Gaiman is when he says that 'Novels accrete,' and when you're writing the best feeling is most definitely when you feel like you are the first reader, then the writer.