It could be that the storylines became repetitive or the production costs were too high. Sometimes, changes in the network's programming strategy can also lead to cancellations.
Top Gear was cancelled mainly because of a decline in viewership and some controversial incidents involving the presenters that affected the show's reputation.