In this context we are talking about the work done by a gas.
Rather than representing it as w=−PADw=−PAD, think of the formula as representing an area (that the gas is pressing against) moving a distance DD. Since this a change in volume, we can set w=−PΔVw=−PΔV
If you are putting work into the system (say pressing a piston into a cylinder containing a gas at a given pressure), the volume is becoming smaller, so ΔVΔV is negative. The negative of the pressure times a negative ΔVΔV is a positive value, which matches with the sign convention for putting work in. Vice versa, an expansion of a compressed volume at a given pressure will push the piston back out of the cylinder and allow the gas to do work, so ww is negative which follows the sign convention for work output.