Bitcoin's traditional answer to this question is "pseudonymity, not anonymity".
All data published on the blockchain is necessary for the world to validate that the transactions are valid, that no theft occurs, that money is not printed, … but no more. In particular, there are no identities on the chain and the reuse of addresses (otherwise visible) is discouraged.
Of course, this balance is very fragile and delicate. In fact, it is actually very difficult to publish enough to allow the world to validate, but at the same time, not reveal enough to disclose significant amounts of information.
Systems like Monero and Zcash go even further. They "encrypt" some parts of the transaction data, but include complex mathematical proof that the encrypted data is still valid. This allows them to hide amounts and links between transactions. However, these techniques come with their own trade-offs in performance, bandwidth, and scalability in general.