People have studied music and composition since at least ancient Babylon, so, well, yes?
>I always thought it was just some natural ability that people have.
With natural ability you can sing some melodies. For learning to play an instrument, adding chords to the melody, you need studying, even if you learn by yourself and by ear (as many folk musicians did). Song melody, one can have a natural feel for creating, but nobody just starts writing songs in full form "from natural ability".
>For as long I can remember if somebody told me to write a song I would just spit it out after a while.
What would that mean? You'd write a song on the guitar for example? If so, then you already know the chords. And not all of the theory, so how complex is your song? Just barebones songwriting (country/folk style)? Can you take it further? Can you write the parts for musicians to play on your song? Can you write different genres on spec?
There are more things in making music/songs than "spitting out" some melody.