By popular request, I am posting my comment as an answer.
By giving up Macau quietly, Portugal avoided an embarrassment similar to the one they experienced when India took GoaIndia took Goa.
More seriously, this was done as part of a treaty at a point in time where Portugal was carrying out a policy of de-colonization. Portugal basically offered to return Macao to China.