Using third-party code is not always the best way to go (that is, assuming that you have found third-party code that meets your requirements), but rejecting it outright is similarly unwise.
The decision ultimately rests with whatever combination of requirements, timelines, developers, managers, and clients is involved in a project (as well as all of those who have been involved on the project in the past, if that's the case).
But let's take a look at both sides of the scales.