Battleships are typically extremely expensive, offensive vessels that take a lot of resources to build and operate. Not only do they require large amounts of personnel and equipment to run on their own, you also have to crew and supply the requisite supporting fleet of vessels (transports, frigates, destroyers etc). Since Star Fleet'sStarfleet's stated goal is the peaceful exploration of space and diplomacy, such a vessel, and fleet, would not be in line with that goal.
That is not to say that they have never built offensively oriented vessels. The most famous such example is the Defiant class ship, featured on Deep Space Nine. Originally designed to combat the Borg, the ship featured an oversized warp core, phaser cannons (in addition to phaser arrays), multiple fore and aft torpedo launchers, and as a special case with the USS Defiant, ablative armor.
But keep in mind, even though the Defiant class was arguably a war ship, it was still labeled as an escort vessel (i.e. it's primary purpose was to escort and protect other ships). Star FleetStarfleet would have had a hard time calling something as large as a battleship an escort.
With that said, there are only two on screen ships I can think of that fit the battleship classification, neither of them Star FleetStarfleet:
But all that aside, Star Fleet'sStarfleet's vessels were well suited to go on-oneone-on-one with matching classes of ships from their contemporary adversaries. Although, watching any of the shows may not make that evident as the ship would often be on the brink of destruction to build tension for the plot.