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:
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).