Why would a dentist give you a splint for tmj?

Treatment. The splint helps prevent parafunctional forces from tooth to tooth contact, which in turn decreases stresses on your joints and muscles of the jaw.
Diagnose before Rx. A splint is a diagnostic device that is reversible. It is used to change the bite without affecting the teeth (short term) to see if the bite is part of the TMJ cause. The splint with physical therapy are good ways to see if a better functional position will decrease the signs and symptoms that affect the patient. If the diagnostic treatment is successful treatments to this position follow.
Break the pattern. There may be many reasons to use a splint and there are many types of splints. One reason is to break a pattern of clenching or grinding. The separation of the teeth stops the unconscience feed back loop/reflex habit. Sometimes the teeth and bite are locking the jaw into a position that is restricted causing muscle tension. A splint with its flat surface removes the restriction.
To help symptoms. To help symptoms and decrease pain. To help clenching/grinding of teeth. To help smooth out an uneven bite. To try to reposition a displaced TMJ disk.
Several reasons. Prescribing one to wear a splint for tmj/tmd is quite common, but the type is often dependent upon the symptoms and dentition of the patient. A custom splint is definitely recommended over online or otc non-custom mouthpieces. Grinding, clenching, protecting teeth, calming muscular stress patterns and realignment of the jaw joints are just a few reasons to consider. See a specialist.