There is nothing to be called as automatic release of sperm. I think you are trying to mean Semen. Which at times comes out on thinking or dreaming erotic(Wet dream/night falls). It usually occurs during sleep. Which is an absolutely normal phenomenon at your age. This is actually equivalent to conscious masturbation. It has observed that in younger age if someone try to restrict his sexual urge by not doing masturbation as per bodily requirements then there are increased chances of semen spill over in the form of automatic night discharge or wet dreams. So this kind of phenomenon is absolutely normal.
Next Steps
You should not think negatively towards a normal bodily function.
Health Tips
Do physical exercise and yoga. Masturbation in normal way is absolutely a natural and acceptable bodily mechanism. Thanks