Attributing goal-directed behavior is something we tend to avoid doing in biology, though, as we cannot ever empirically deduce what the
purpose of a molecule existing or performing a function may be (and indeed, the premise itself assumes that such a purpose exists, which is more in the realm of philosophy or religion rather than science). So from a scientific perspective, at least, we would be asking what role the heart has in a process, or what would functions would change if we changed some aspect of the physiology or chemistry involving the heart, rather than asking what it is
for.
Ends are not frustrated, because following the reasoning above, there is no one single end. Diversity is at the heart of biology, for without it, extinction would surely follow. Adaptability helps assimilate and respond to stimuli in the environment, and allow a reaction accordingly. An action performed by a human that has no deleterious effects on the survival and propagation of the species in the long run would not be a target to be selected against (and phased out) by evolution.
Humans in particular are good at adapting to (or changing) their environments and behaviors in response, including the use of tools that we didn't expressly evolve organs to utilize, but it represents the diversity of behavior possible by us that, if not deleterious, would not necessarily be selected against by evolution. But being able to respond to the unseen is part of what makes us successful. A tool like a computer, for example, has multiple potential uses and functions, but to define a strict sense of what its functions should be rather than what they have shown to be capable of (and that has shown to have benefits in some regard) would require an external source of morality applied to it, rather than an intrinsic one.
These "
side effects" as you may call them are just part of what makes evolution so fascinating, but it is easy to fall prey to fallacies of forcing biological facts through, as you said yourself, interpretations that may distort facts to serve a philosophy. The penis isn't simply a reproductive organ, but is also, as you know, a path for the body to excrete waste. I see the diversity of function as the ability to respond to a multitude of needs in different environments in the same way that our hunter-gatherer forbears were able to switch between plant and meat-based diets depending on availability.
There are multiple, valid approaches and uses of a single "tool", and culture alone shows that human behavior is full of diversity, encompassing the different ways we eat, grieve, or even perceive and define color in our environment. Masturbation, oral sex, anal sex, vaginal sex, and intercrural sex are all representative of the diversity of behavioral expression possible involving our sex organs, used to relieve stress, used socially, or to procreate, and so on. From a biological perspective, humans fully support the ability to be bisexual without deviating from a set function, as one doesn't exist. Those that make the claim that one does would have a heck of a time trying to support that argument without referring to an external source of morality, and also make the case as to why it should be considered over others. It isn't always as simple as the chicken preceding the egg.
EDIT: Y'ALL BANNED HIM!?