And why the flower in the sentence?
As far as I know it usually follows sentences like 待つうちが花 － 言われるうちが花 etc that are some common sayings although hard to directly translate in English. The first one expressing the feeling of enjoying to the fullest the moment while you are waiting for something to happen making expectations. In other words, that there is good in that time you spend waiting speculating about how something will go.
Here it says:
In this case my guess is that 花 is there as an example of something beautiful or pleasant. If you look at the meaning above this somehow makes sense. I think I even read that this is the case somewhere actually but cannot find it now.
Here are some other proverbs/sayings ending in うちが花 although the question is a bit different (won't reference them directly as maybe it's not the point). According to that source it seems that most of these derive from 言わぬが花， that could be translated as "Some things are best left unsaid" or "Silence is golden".
Also looking at this it seems that the flower could be a symbol of something beautifl/pleasant as so is the result of not saying something. This is actually a particularly interesting example as you could see the "flower" in Japanese playing the role of "gold" in English.
In general it's an interesting question, but if it is mostly used in proverbs maybe it's hard to give a precise answer and would be better to think about it as a whole thing carrying some meaning. It would be like asking "Why is silence gold"? Because I guess gold is a precious and good thing, and so are flowers.
- ～うち: a (limited) term, period that —; while —
- 花: the finest; (at) the crest; glory
So the overall translation would be "the moment while — is the finest". The construct ～うちが花 is commonly applied to two situations. One is literally, the times when you X is your best hours or palmy days. The second is that you may be annoyed by X, but it's better to you than when you no longer are X, so you should treasure or make good use of X.