It depends on what you want to do while you are in port. If you just want to get off the ship, wander around and go shopping, I would say no because you can do that on your own for free. If you want to do something more adventuresome, it may be well worth the cost of booking a shore excursion through the ship because the cruise ship company picks reliable vendors that have a good safety record and if for some unforseen reason you are late getting back to the ship, the ship will wait for you. As another answerer mentioned, for some shore excursions the only way to do them is through the ship because the cruise lines have all of the spots booked. If you want a less adventuresome shore excursion and are willing to do your own research to find an availab, reliable tour guide, you may be able to find doing the same shore excursion for less, but if you are late back to the ship it will leave without you. Here is an article about a cruise with a mix of shore excursions - some booked through the ship and some not:
http://www.squidoo.com/Mexico_Cruise