You have to keep in mind, Star Trek's actual ratings were respectable, and indeed many shows with worse ratings were kept even at the time. The problem was that Star Trek was a problem show. From the perspective of the studio and network, Star Trek was a pain in the ass that wasn't quite worth the trouble, particularly as it went on and some of the scandals were more than just embarassing, but potentially (if not outright) criminal.
But there really was a lot of excitement and acclaim at its time for such an unusual show. TV Guide featured it heavily, for instance. And it won many awards. But, after the first two years of all the issues, NBC and Desilu were sick of it. They honestly wanted to be rid of the show, or - more specifically - some of the people working on it. Roddenberry's replacement allowed for a third season, but Fred couldn't salvage the damaged egos and relationships that were left (which showed on screen at times) and the show was ignamously killed by buring it in the worst possible time-slots.
But there really was a lot of excitement and acclaim at its time for such an unusual show. TV Guide featured it heavily, for instance. And it won many awards. But, after the first two years of all the issues, NBC and Desilu were sick of it. They honestly wanted to be rid of the show, or - more specifically - some of the people working on it. Roddenberry's replacement allowed for a third season, but Fred couldn't salvage the damaged egos and relationships that were left (which showed on screen at times) and the show was ignamously killed by buring it in the worst possible time-slots.