It's because it's software that's rather complicated (databases are big things, and they need to be fast and reliable), but mostly because typically only companies will use it - so they charge more, because companies can afford more. Indeed, a company would probably not buy a database at $40 - that looks very, very dodgy.