
Like anything else, you have to study it and do it a lot. I'm just starting myself. If you like book learnin', I read the book 'How Music Really Works' by Wayne Chase and found it very helpful in moving from making fun 10 second loops to actual songs. And of course learning an instrument (synths are instruments) is a whole separate task on top of learning how to compose music.
Given your instrument choice you might also be very well served by the "Music Theory / Harmony / ... for Computer Musicians" series by Michael Hewitt.