Answer:
It was developed for hypertension. The erectile function was discovered more or less accidentally.