What are the possible reasons that books were designed this way
This history of publishing goes back to manuscripts. Monks would use calligraphy to replicate the text from one book into a new book. It was likely impractical to die parchment and impractical to create a white ink.
That was followed by the era of moveable type. Again, it was likely still impractical to have black paper and a truly opaque, white ink.
Which leads us today, with offset printing and digital printing. Again, it's still impractical to have died paper and white, opaque inks and toners...as well as impractical to print in reverse, as it would simply take too much ink and be difficult for most printers to handle.
It's not so much a UX issues as an issue of practical implementation.
Further to all of that, a black page would make taking notes difficult, would prohibit easy highlighting, would be difficult to read in low light, etc, etc.
However, we now have eBooks. And now it's finally practical. And, as such, it's now typically an option on most eBook readers and tablets.