To direct flow
A heart valve functions to allow unidirectional blood flow.
When chambers of the heart contract, one heart valve will open and one will close; this effectively allows only one low resistance pathway for the blood to follow. If there were no valves, blood would flow backwards from where it just came as well as forwards. This would significantly decrease the effectiveness of the heart as a pump.