I think people need more detail about what the fan clutch is doing and is not doing to diagnose whether there is anything wrong with it.
The fan stops moving when your car is idling? It stops moving when you are are at speed? Does this occur when the car is warm (after a 15min/30min/45min drive), when you first start the car, when you are sitting in traffic? Are you saying your temperature gauge is sitting in the middle? Or the temperature gauge is past the halfway mark and when the fan is working it brings it back down to the halfway mark?
As far as overheating in general it could be any one of a number of things causing the problem. The cooling system is composed of the radiator, expansion tank, water pump, thermostat and thermostat housing. All of those components fail over time on the e39. The usual recommended preventative replacement interval is between 60,000 miles and 90,000 miles. It is also recommended that you flush the coolant and replace it with fresh coolant every 2yrs (most recommend BMW coolant to make sure you are getting the correct/compatible stuff for you car). There is also a auxiliary fan and I believe a temperature sensor for that fan.
As someone else said if you keep taking the car to the same shop and they have replaced the same part 5 times, they don't know what they are doing and/or are very unfamiliar with BMWs and the e39. You need to get the car to a quality independent BMW specialist or suck it up and take it to a BMW dealer.