Many funding agencies require formal data management and/or sharing plans as part of their granting process. Each funding agency has specific requirements so be sure to check for your specific grant.
This represents just a selection of foundations and organizations that have policies related to data.
More and more journals are adopting the Joint Data Archiving Policy as shown below. Check the Instructions to Authors for details on how to handle associated data files before submitting a manuscript to any journal.
Authors will often need to include in their article a statement detailing where the supporting data can be found (aka "Data Availability Statement"). Authors may be able to justify their reasons for not sharing.