Your "select" and your "group by" don't match.
SELECT
s.yearID
, s.teamID
, SUM(s.salary)
, t.W
, SALARY / t.W
. . .
GROUP BY s.teamID
Anything that you select that isn't in an aggregate function (sum, count, etc.) must be included as a "level" within your grouping. If you don't, then you get all sorts of odd results, just like this, because MySQl doesn't know how to roll things up - you haven't told it.
Try something more like this:
SELECT
s.teamID
, SUM( s.salary ) AS SALARY
, SUM( t.W ) AS WINS
, SUM( s.salary / t.W ) AS CPW
from salaries s
inner join teams t
on s.teamID = t.teamID
and s.yearID = t.yearID
where s.yearID = 2002
group by s.teamID
order by salary desc
;