That is an excellent question and one that is best answered after a complete physical examination and history from your primary care doctor
or other medical care provider. It is very difficult to answer your question based upon the limited history available as it is unclear what medical problems you have, or what age you are. It is somewhat concerning that this is happening and there are no common causes for something like this and so it is important that you are seen by your doctor so he or she can perform the appropriate work up and diagnostic tests to elucidate the cause of this. They may suggest you visit a specialist such as a urologist
to better understand what is going on and what options are available to you. It is not suggested that you begin any medication for this problem until you have had a complete work up for what is the underlying cause of these symptoms and then a doctor can prescribe the appropriate treatment options which may include medications. Also, are you sure this is sperm and not another type of discharge from your penis? Your doctor can test you any find out exactly what the cause of this is.