The main purpose of this legislation is to protect medical residents from being required to undergo training related to abortion procedures as part of their residency programs funded by Medicare. The bill aims to ensure that participation in such training is entirely voluntary, allowing medical professionals to maintain their personal and ethical beliefs without facing discrimination. Key provisions of the legislation include a clear prohibition against residency programs requiring training in abortion procedures unless the medical resident has voluntarily chosen to opt-in.