A York paedophile jailed for obscene behaviour on a North Yorkshire beach and other sexual crimes harassed a police officer from behind bars.