The French fought against the Vietnamese so soon after World War II because they felt that it was very important to their country to regain their empire. They felt this for two main reasons.
First, the French wanted to regain their empire for the sake of their prestige. The French had been defeated rather quickly by the Germans in WWII and felt that this defeat had damaged their image in the eyes of the rest of the world. If they were to relinquish their empire it would be a further hit to their image as a major world power.
Second, the French wanted to regain their empire for economic reasons. World War II had devastated much of France. This had led to a situation where the economy of France was very badly weakened. Because of this, the French wanted to keep their empire so that it could help them to reinvigorate their economy.
In short, the French felt that it was important to fight the Vietnamese even if they had just gotten through with WWII. They felt that they had to fight because it was so important to regain their empire.