Does that matter? If you're looking to develop a drug to treat hypertension but end up with Viagra by accident instead, do you throw it away because that wasn't the original goal?
It certainly matters if you've still got a lot of people running around telling anyone that will listen that the drug is a sure-fire cure for hypertension.