I have noticed in my own songs and in general that the main melody of songs in in the high part and the accompaniment is in the lower part. Why? Is there a biological or theoretical reason for why this configuration is preferred?
That's not the case "in general". Take a look at Simon&Garfunkel, or typical polyphonic passages in Beatles songs. Also for barbershop, the melody tends to be in "lead" which is below the "tenor" voice.
Now the counterexamples are actually a good clue for figuring out the rule: in those examples, the higher counter melodies are typically sung in light head voice or falsetto. Which means that they have considerably fewer harmonics than the leading chest voice. So in this case, even though the fundamental of the leading voice is below that of the counter, its harmonics dominate more of the higher spectrum.
Now harmonics are what distinguishes various sound qualities and, in particularly, the vowel formants in speech. So human hearing is quite adapted to hearing and distinguishing slight variations in the high pitches corresponding to harmonics of the normal speaking voice.
The natural tendency of a western-music-familiar listener is to hear the highest note in an arrangement as the melody note. Nobody tells people to hear it as such, they just do. Thus, for many years it was a standard "rule" for a big band arranger writing horn charts and such to put the main melody in the top voice. This is of course more a convention than a rule, and you can find countless examples where it is not followed.
A great example of this is in SATB chorus: the altos and baritones/basses rarely get the lead melody line, which instead goes to the sopranos and tenors. Sopranos and tenors are just that much better at projecting to the back of the hall than the altos and basses.
Of course it's a time-honored arrangement method for orchestra to have the first violin state a melodic motif, then "pass it around" to the other, lower-register instruments. Counter-melodies can weave in and out of the main melody, moving into the top voice to gain momentary emphasis, etc.
SO, the convention of putting the melody in the highest voice is primarily born from the very real experience of NOT doing it and finding your intended perceived primary melody disappearing from aural view.