23andMe has experienced at least one significant data breach where hackers accessed user accounts, so your concern isn't unfounded. The real issue is that you need to separate a few things: the company's own security practices, what they're legally allowed to do with your data, and what you're actually consenting to when you sign up. They do sell anonymized genetic data to pharmaceutical companies and researchers, but that's disclosed in their terms of service - it's not hidden. You can opt out of that sharing, though it's buried in the settings.
The privacy risk depends on what matters most to you. If you're worried about law enforcement accessing your DNA through databases, that's a legitimate concern since they've done it before. If you're worried about the company itself selling identifiable information about you to insurance companies or employers, that's technically illegal under GINA (the Genetic Information Nondiscrimination Act) in the US, though obviously laws can change. The bigger practical risk is probably a data breach exposing your raw DNA file, which could theoretically be used to re-identify you later as technology improves.
If you decide to do it, read what you're actually opting into before submitting anything. You can take a DNA test and choose not to participate in research sharing. You could also look at smaller competitors that have different privacy policies if 23andMe's approach doesn't sit right with you. Just know that no company can promise 100% security - it's about whether the risk-benefit tradeoff works for your situation.