Your fan is running because your computer is too hot. The fan on the computer is designed to increase air circulation and prevent heat damage to the electrical components.
Dirty computers can cause overheating, which leads to the fan constantly running. Your computer may need to be cleaned to eliminate dust. Another cause could be that you are using your computer a lot. The more a computer is used, the hotter it becomes and the more the fan is needed.
Malware and viruses can also cause your computer to act in strange ways and may also cause the fan to run constantly.