What is the reason why the Celestial Spirits work for their wizards (such as Lucy)? I understand that they have a contract, but why do they get into the contract at all? I could not think of anything they gain from the contract.
I didn't manage to find any sources that answer this question exactly, but I'm going to speculate about it a little.
My opinion is that the spirits are forced to appear once the wizard acquires the key. The key, as we know, is usually required to open the gate though which the spirit comes from the spirit world. When the gates are opened in the first time, the wizard and the spirit make an agreement (e.g. on which days should the spirit be summoned).
Now, if you look at how do the spirits react when Lucy calls them, you may notice some interesting things. For example, when she summons Aquarius, Aquarius is often disappointed with Lucy, and shortly returns to the spirit word, sometimes refusing to do what Lucy asks for.
One might ask: why in that case would the spirit even appear? If Aquarius is not in the mood, she could as well not appear at all, rather than be summoned and almost instantly go back (after a few insults towards Lucy, that is). That leads us to an assumption that the spirits can not actually refuse to be summoned, and possessing the key almost equals possessing the spirit's contract (they just have no other options).
Some spirits, however, find benefits in working with the wizards, for example, Taurus enjoys being summoned because that way he can observe Lucy's body, which he admires.
In general, most of the spirits become very loyal to Lucy once she acquires their keys, so that is another argument for the assumption that possessing the key forces the spirit to make the contract and work for the wizard.
In the episode where the Spirit King appeared because Lucy exclaimed that she would change the rules of the spirit world, he said that the spirits and humans had an agreement together. That "agreement" can mean the contract between the spirit and the wizard, or it can mean that something happened between the humans (probably wizards) and the spirits which made the spirits be indebted to the humans, therefore, they pay it with their services to the human.
This may not completely answer your question, but spirits are born to help their "masters" and carry out orders. Whether they listen to the wizard or not depends on the spirit's personality. For example Aquarius would usually go right back to the spirit world after being called. But other spirits that have more loyalty towards Lucy would stay by her side.