Hi, semen (what you called sperm) being discharged in the night during sleep or dreams is called nocturnal emission. Also known as sleep ejaculation or night fall.
This is a natural even for almost every man - especially young, unmarried men. This is the body's way of checking your ejaculatory mechanisms, emptying the 'old stock of semen' [ :) ], and releasing sexual tension building up in you through sexual feelings and fantasies.
Next Steps
It's not a disease or disorder and does not require any treatment. It does not weaken you, does not cause any health or sexual problems now or in future. Okay?