Does pre-packaged spaghetti sauce need to be cooked?
No. Canned food (when done correctly) is preserved properly and is safe to consume without further cooking.  Imagine that it's jam or oil packed sun dried tomatoes or canned tuna... something similar that's jarred or canned and then never (or only sometimes) cooked before consuming. There's nothing unsafe about it. 

If it was unsafe, no one would can foods.