The Sentry - and its arc and rocket cousins - is an emplacement designed to be set up well ahead of time, not as a reaction. It takes a few seconds to set up, but it's still vulnerable and can be targeted and damaged while setting up. It won't do any good deploying one to protect a Hardpoint when it's already overrun by enemy infantry.
That said, Sentries provide respectable single-target damage and 360-degree coverage that improves if you deploy it at an elevated position. Set it up to protect a Hardpoint you already control (in tandem with other defensive units) or to cover a neutral Hardpoint your Pilots and infantry are on the way to capture. Make sure to refresh any defenses with a new turret if you have the resources to spare, since their health slowly decays over time. It's a good deterrent against man-sized units and a decent distraction against Titans.