Why carbohydrates and lipids basically used as a sources of energy? Why only proteins are used as building blocks of all the creations? Yes there are some parts of cells like cell walls in which carbohydrates are used but 98% portion of cell is made up of proteins? Why it so?
First, it is a matter of the energy that food can provide. Here fat wins clearly (from the Wikipedia article on Food Energy):
Proteins and Carbohydrates have approximately the same energy content. But the advantage of carbohydrates (and especially glucose) is that is can be taken up by the body and the cells pretty fast, while proteins need to be digested and broken up, before they can metabolized further. Also plants make primarily sugars (or derivated polymers like starch), so carbohydrates are readily available in the food. Fat and sugars are chosen for nutritional reasons, since they have a higher energy content and are available for it.
Structural components are build by proteins, since the 20 amino acids allow a much greater diversity in the protein chains than it would be possible for fats or carbohydrates. The building blocks are relatively small and simple but they all have the same basic structure (carbogroup, aminogroup and the sidechain) which allows linking via the functional group and the sidechain influencing their behavior (hydrophobic, hydrophilic, charged, etc.).
There can be many reasons for why proteins are chosen as building blocks. Apart from what Chris said, I would add some points:
But having chosen proteins as the functional molecules it won't be a nice idea to use them for energy storage unless there is extreme need (such as starvation). Fats being hydrophobic wont easily suffer attack from the regular reactive species in aqueous solvent; this makes them good storage molecules. Same case with carbohydrates, which arise from carbon fixation. Despite the existence several types of sugars the chemical spectrum is much less compared to amino acids.
And then there is the reason that Chris pointed out based on calorific value. But I would add a point on this regard: the energy in a food cannot be just measured by their absolute thermodynamic calorific value. For e.g. cellulose (which is present in fibers) has the same constitution as starch but provides practically no energy to humans because it cannot be digested. And in plants it plays a structural rather than functional role. So exceptions exist at least in the case of carbohydrates.