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