A police officer has been dismissed without notice after he sent sexual messages to a vulnerable 14-year-old girl he met on the job.