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