ITT, a bunch of people who know literally nothing about this subject offering explanations.
The character 零 ("líng") contains a semantic component (on the top) and a sound component (on the bottom), the semantic component is 雨, meaning rain, and the sound component is 令 "lìng".
The word initially referred to very light rain and so the character essentially means "the type of rain that sounds like lìng". For whatever reason the meaning drifted from very light rain towards "barely any" and then "nothing/zero".
The bottom/top usage is simple, the "zero" is the receiving hole and the "one" is the penetrating appendage, i.e. the submissive versus the dominant partner. That usage is definitely slang, though!
Ultimately that's the origin of the character. Although it's quite common to see "〇" in written shorthand when 零 is being used as a middle or final zero in a number otherwise written in characters, like 906 could be written as 九零六 or 九〇六.