Why do things smell good while cooking but have little flavour when finished
There are two components to flavor: aroma and taste.  The wonderful smells you get are the volatiles of the ingredients you have been cooking, and while they add a lot to dishes, aromas are just part of what makes food enjoyable. One also needs to worry about taste, and that may be the missing part.  When I decided to improve my cooking three years ago I was mystified by flavors.  I wanted to know how spices worked and how to use them better, but all the reading and experimenting did not help my cooking.  

Then I learned the Remick Maxim (lower the temperature when possible) and the quality of what I made went up more than in the entire previous year.  I then heard Thomas Keller speak about salting and things clicked.  One has to get the salt, acid, and sweetness of the dish right or everything else amounts to nothing.  Once I learned to pay attention to taste, spices became easier.

The next steps have been:


Understand caramelization (the Maillard process or reaction), it is a great source of flavor.
The main ingredient needs to be rich in flavor. Even something as simple as rice will make a difference.  Try making rice with Basmati from India or Pakistan, where they age the rice before selling.
There are a lot of underdeveloped recipes out there.  Beware.
Use spices in groups that traditionally grow in the same region.  Cumin and coriander, basil and thyme.