CockroachDB is compatible with PostgreSQL due to several reasons. Firstly, adopting an established network protocol like PostgreSQL allows a new RDBMS to make itself immediately available to a larger ecosystem of existing client code. Secondly, choosing compatibility with PostgreSQL ensures that users do not have to learn too many new things just to use CockroachDB. Lastly, the choice was influenced by factors such as clearer documentation, compatible licenses, and a more principled approach in PostgreSQL compared to MySQL. The decision has been beneficial for CockroachDB's adoption and development process.