My answer is that it is fine to restrict player choice in the name of flavor. However I also think it's critical that everybody have a clear conception of what that flavor is, how it restricts things and still want to play in that game.
We have a talk at the outset of any campaign (typically on a night when we're making PC's) that I've come to call "The Buy In Conversation". This is where the GM explains the setting and the themes involved in it and what kinds of characters will be appropriate. The players can ask all the questions they want about the setting in general and themes described. Once all that is hashed out, we have a tacit understanding that the GM is agreeing to run a certain type of game and the players are willing to play that sort of game. Everybody has "bought into" the campaign.
As an example, our current game is Warhammer FRP, pretty much right out of the box (though there isn't actually a box) but with the theme being "zero to hero". That is that all the PC's start out in lowly, crappy professions but gradually rise above that to become heroes of note. It was also understood that this campaign would have a heroic bent to it. In other words, when deciding what careers to move into, we avoided stuff like Assassin and Crime Lord. When faced with choices in the campaign we were not expected to be Lawful Good or anything like that. But we were expected to generally behave kind of "Good".
Since everybody is on the same page about this, we seldom have any problems with the GM having to disallow anything.