To keep the three layers (quilt top, batting, and backing) from shifting or wrinkling during the quilting process.
Let's look at all your basting options.
Option #1 Pin Basting
Pros: Relatively inexpensive. Pins are reusable so once you buy them, they will last a long time. Accurate; gives you a lot of control and you can baste densely or sparsely as needed.
Cons: More expensive if you spring for specialty curved basting pins. Time consuming. Awkward to pin the center of a large quilt. Difficult if you have any pain in your hands. You must stop machine quilting and remove pins as you work; you do not want to catch your hopping foot on a pin, or run your walking foot over a pin.
Option #2 Spray Basting
Pros: Fairly easy. Fast. No need to stop quilting to remove pins.
Cons: Costly; a can of spray baste will run you $10 to $20 depending on the brand. Stinky. The sticky overspray gets all over everything. Some brands of spray baste work better than others. Sometimes you have to re-iron to re-activate the fusible, which sort of negates the whole time-saving idea.
Option #3 Thread Basting
Pros: Cheapest option. Uses only needle, thread, and scissors, all of which you probably have already. This method gives a lot of control. You feel the fabric and can ease wrinkles as you baste, and you can baste as densely as you choose. No need to stop quilting to remove pins.
Cons: Time consuming, can be labor intensive.
Option #4 Gun Basting
Pros: Quick. The basting gun can be used for other purposes, like upholstery and labeling your quilt (think price tags for a craft show).
Cons: Must buy special equipment. Gun runs about $14-40, a pack of plastic basting fasteners start at about $8. Repetitive motion injury risk from pressing the trigger over and over.
Option #5 Fusible Batting
Pros: Fairly easy, quick. Batting has heat-activated glue in its surface, so you layer your fabrics and iron to activate the glue. Especially good for small projects.
Cons: This process can get tricky with a large quilt. Sometimes you have to re-iron to re-activate the fusible, which sort of negates the whole time-saving idea.
Option #6 Long-Arm Basting
Pros: Quick, easy, especially if you already have a long-arm sewing machine. Smooth, even, sturdy.
Cons: More inconvenient if you have to deliver it to someone else and pay them to baste for you.
The bottom line of basting is CHOOSE WHAT WORKS FOR YOU! Try different methods if you are frustrated with what you are doing now.