A man who lived in New Hampshire but worked as a pastor in Massachusetts has been charged with failing to register as a sex offender in the state where he worked.