Because significantly less of the money you pay goes to the person who wrote the book.
For 99%+ of authors, writing is a hobby that pays less than minimum wage. For self published authors it's often a net loss after costs like editors and cover design.