Thank you for asking. I can understand your concern. The white thing is ejaculate, which is discharged on reaching orgasm. It can be during masturbation or during sex. Rubing against bed stimulates your penis and discharge occurs. It is normal. Perhaps because you have not form habit of obtaining stimulation during sex with your wife, you are facing difficulties with reaching orgasm during sex.
Next Steps
I would suggest you to continue having intercourse with your wife. It may solve spontaneously. Best would be if you can visit a sexologist.
Health Tips
Don't worry. It is normal.