To prevent the spaghetti bake from sticking, spray your pan with nonstick spray, rub it with butter or oil, or line the pan with parchment paper. This will allow the spaghetti to release easily, and makes for easier cleanup as well.