So what is the dilemma? Just write what the important people want to hear and if you know your trade, all will be well. Composers like Rossini and Meyerbeer achieved great material success by so doing--not to mention a considerable musical success as well! But there is always another role for music: that of being outside the main stream, of being a commentary, perhaps, on the mainstream. When Glinka was young he availed himself of all the musical education he could and then supplemented it by traveling to Italy and Germany for further study with the great masters. Then he returned to Russia, became aware of what was needed in ideological terms and delivered the goods. When I was young, I availed myself of all the musical education I could (though I was focused on playing the guitar, not composition) and supplemented it by traveling to Spain and Austria for further study with the great masters. What I was never really aware of was the ideological context. I was, I suppose, a musical romantic of a particular kind. I grew up with folk music (from my mother) and popular music (from the rest of my environment). I became musically aware in the mid to late 1960s so the artists that loomed really large were people like the Beatles, the Rolling Stones and Cream. Then I discovered classical music and that commanded my devotion for a long time. But the ideological residue of my early years was that music was something that was outside the social mainstream. It was the voice of an individual artist (or small group). It was not about expressing the ideology of the society--it anything it was a critique of that ideology. Plus, temperamentally, I was drawn to a kind of individualistic aestheticism.
Here's the dilemma: assuming you have learned the craft of composition, you have a choice. Either write from an idiosyncratic, individual view or write for one of several different social groups. These might include those people and organizations that provide commission funding, or you could try and capture some of the general public audience but to do that you will need to work within pop music genres or perhaps do soundtracks for movies or television. Some composers have developed their own specific base of fans and supporters over a length of time, acting like entrepreneurs.
But we are still confronted with the dilemma: in order to do any of the above things you have to discern what it is these groups of supporters want to hear. And then decide if you can really give them what they want.
What I am doing in my own compositions these days is trying to create a repertoire of some substance for guitarists to play. I suppose I deal with the dilemma by ignoring it! As a composer friend of mine said to me once: "I just write down the notes that sound good..." His name is Anthony Genge and here is a piece of his based on the medieval 'hocket' in a recent performance:
UPDATE: I neglected to put up some Glinka. Here is Anna Netrebko singing the Cavatina and Rondo from Act I of A Life for the Tsar: