Cars have all wheels covered with hubcaps but I noticed that trucks and buses only have them in the front wheels. Even, sometimes I've seen long vehicles with covered wheels also in the back side too, as the one in the picture attached. What's the reason behind?
That isn't a hubcap, but rather it's the rim itself. If you notice, the axle which looks different has two wheels on it. The dual wheels are placed face to face (or back to back, if you like). This puts the mounting point at the same place. Both wheels are mounted to the same lugs. This makes mounting easier and more cost effective. In the center axle with dual wheels you are seeing the dish of the wheel, where as the single wheeled axles you are seeing the face. (Yes, the rear axle only has single wheels on it for a bus). On semi tractor/trailers, all but the front axle has dual tires on it (unless there is an intermediate drop axle, which probably would only have single tires on each side).
The reason on a bus why there's only a single wheel in the back is because it is an idler axle. Only the single driven axle (is what provides the propulsion for the vehicle) has dual tires on it. The idler axle just provides support and helps improve the ride quality. On semi-trucks, the two axles in the truck portion are both driven. This gives them extra traction. The trailers have dual tires on both axles, even though they are not driven. This is to provide extra support for the trailer as well as to have more tire surface on the ground to support the load (in the States, 60,000 lb gross value weight or GVW is the common maximum load). These also provide traction for braking as well.