Why is it "Det er en bog" instead of "Den er en bog"? If "bog" has a common gender and it's called "en bog", shouldn't it be "den" also?
I mentioned this in another comment, but here: "It [unknown item] is a book = DET (neutral form). Thus, " Det er en bog" might mean, I didn't know what was in my bag, but turns out "It is a book"
If you know the item of which you speak, you will likely use the appropriate gender.
It's a question of whether you're speaking of a generic it vs. this specific item
"Den er en bog" could be right, but then you're most likely to say something like "that one is a book" or "that is a book" instead of "it is a book". There are also more words which use "en" but have "det" (and vice versa) when using a specific term. I don't know the rule for it (or even if there exist a simple one) but I know that at least in Swedish it's very confusing for someone who isn't used to the language when to use "det" and when to use "den". Good luck!