This temple was built to prove that Narathiwat Province was indeed part of Thailand.
At the time of construction, Narathiwat Province was part of Kelatan state, Malaysia, and thus under British rule. Following the construction of the Wat, the British relinquished their claim and agreed for the Sungai Kolok and Tak Bai Rivers to be the dividing line. Within the grounds there is an excellent museum that narrates the role the construction of the wat had in determining Thailand's southern border. The main building also has some very nicely painted murals, though, as with the museum you may need to find somebody to open it up for you. The Wat is situated about a five minute walk from the central market at Tak Bai -- it is well signposted and easy to find.
The Travelfish newsletter is sent out every Monday and is jammed full of free advice for travel in Southeast Asia. You can see past issues here.