You are expected to understand the ethical and legal issues surrounding your data. The management of sensitive data is a part of good research practice as it ensures you uphold high ethical standards to minimise the risk to participants, researchers and the institute.
Once researchers employ approaches of informed consent, anonymisation and managing access to data, research data (even sensitive data) can be shared ethically and legally.