In thermodynamics work done by the system is negative but in case of expansion of gas it is positive because force and displacement are in same direction, why?
You are correct. The system does positive work. Textbooks introduce the negative to show that the system loses energy as it does expansion work. As the gas expands, it does positive work but it loses this energy in the process. Work, like heat, is basically a transfer of energy.