Ive seen on a few e39's the vapor barrier behind the door pannel has eather came unglued or someone who did a window regulator didnt seal it properly. Its a black sticky substance that BMW calls Beutal (I think thats the spelling) which glues to foam vapor barrier to the door.
Or like said above your sun roof drains are cloged causing water back up.