In short, the Commonwealth originated in the British Empire, as an association of Britain and its former colonies.
Why did Mozambique (a former Portuguese colony) join?
I expect that the question would be addressed definitively in The Commonwealth Brand: Global Voice, Local Action by Victoria Te Velde (Ashgate, 2011) and in the SADC's Mozambique in the Commonwealth (1997), but I do not have access to the full text of either work.
Factors seem to include the following:
Impoverished shortly after independence, Mozambique had become highly dependent on foreign aid, especially from the Soviet Union. President Samora Machel in his later years, and his successor Joaquim Chissano, pursued stronger ties with other countries and international organizations to balance out this dependence. For example, Mozambique is a full member of the Organisation of Islamic Cooperation and even an observer of the Francophonie
The Commonwealth had worked against white minority rule in Rhodesia and South Africa with the cooperation of Mozambique. For example, Mozambique supported sanctions against Rhodesia and South Africa, seriously damaging its own economy. By the late 1980s, with Zimbabwe having achieved independence and the end of apartheid in sight, Chissano wanted to ensure Mozambique had some influence in the future of South Africa. He requested and was granted permission to attend the 1987 Commonwealth Heads of Government Meeting (CHOGM) to voice Mozambican concerns.
Although there are few direct benefits of Commonwealth membership, there are NGOs and professional associations affiliated with it. Improving Mozambican access to such institutions and their expertise would potentially assist with development.
One must also consider the stalemate of the civil war. The main opposition RENAMO identified with the Portuguese, and took the pursuit of membership in the Commonwealth as something of an insult. Had they been victorious, such effort would not likely have been undertaken. But by the late 1980s, RENAMO was losing support from South Africa and FRELIMO had abandoned its earlier Marxist policies, making peace talks possible— and with the peace agreement in 1992 followed by free elections, Mozambique had fulfilled one of the prerequisites for Commonwealth membership.
There are also all the usual reasons states pursue membership in international organizations:
From the other side, Mozambique was long considered a "cousin" country to the Commonwealth for its trade ties and support of anti-apartheid efforts. They even drive on the left :). Since the Commonwealth does not have an "observer" status, making Mozambique a full member came under discussion. Mozambique fulfilled the requirements of the Harare Declaration, and it is said that at the Auckland CHOGM in 1995, Nelson Mandela himself made an impassioned speech supporting the application as an exceptional case.
The British Commonwealth is an "alumni association" of former British colonies. As such, there are at least a few benefits between them (fewer trade restrictions, more networking opportunities, etc.).
Technically, Mozambique was never "British." But it is a former colony. So it joined a "club" of similarly situated former colonies (people sometimes join the clubs of colleges other than the ones they graduated from).