Benefits of using route filtering:
Economic reasons
When a site is multihomed, announcing non-local routes to a neighbour different from the one it was learned from amounts to advertising the willingness to serve for transit, which is undesirable unless suitable agreements are in place. Applying output filtering on these routes avoids this issue.
Security reasons
An ISP will typically perform input filtering on routes learned from a customer to restrict them to the addresses actually assigned to that customer. Doing so makes address hijacking more difficult.
Similarly, an ISP will perform input filtering on routes learned from other ISPs to protect its customers from address hijacking.
Technical reasons
In some cases, routers have insufficient amounts of main memory to hold the full global BGP table. A simple work-around is to perform input filtering, thus limiting the local route database to a subset of the global table. This can be done by filtering on prefix length (eliminating all routes for prefixes longer than a given value), on AS count, or on some combination of the two; security is the most important point for this.
However, this practice is not recommended, as it can cause suboptimal routing or even communication failures with small networks[citation needed], and frustrate the traffic-engineering efforts of one's peers.