Why Apple
This is all about reducing friction for getting involved in such efforts. If you have the data in HealthKit, and researchers have various projects going on they issue a "call for volunteers" via HealthKit, it is easy to get involved. Today the bar is a lot higher, both for people who want to help advance science and researchers who want to get access to volunteers.
This could be done on a website or app, but it is a lot easier for Apple to get the critical mass needed to make this successful than it would be for almost anyone trying to start a website with the same purpose. While Apple's security will never be perfect, keeping the data encrypted on your phone makes it more secure than if it was kept on a website where it is available to hackers the next time there's a 0 day for Apache or IIS.