You are sure it's the pug doing it?

How old is he? Sometimes older dogs can have urinary incontinence like people do and can take medication to help. The only reason I'm thinking that is because it's been on the bed and dogs with that problem tend to 'go' in their sleep and you said you've been finding it on the bed.

I'd make a vet appt. to not only rule out UTI, but also in case it is incontinence your vet can help there. If it's behavioral then your vet should be able to give you a few tips on things to do at home that may help.

Good luck.