A former health care worker who illegally accessed the health records of Supreme Court Justice Ruth Bader Ginsburg before she died has been sentenced to two years in prison.