There is no such thing as "passing" or "failing" a home inspection.
Certain criteria must meet certain standards, such as a roof needing a minimum life expectancy for a home to qualify for FHA financing, but it's not like your inspector will assign a grade to the roof :-)
What can happen with a conventional loan is that the state of repair of the home can impact the as-is value of the home, which will then impact the actual amount of money the lender will give you towards the purchase of the home. Here's an example:
You're approved for an 80% LTV (Loan to Value) Conventional Loan up to a purchase price of $100,000. That means that your lender will loan you $80,000 towards the purchase and you will have to come up with the down-payment of $20,000 (plus your closing costs, of course).
You enter into a contract to purchase a home for $100,000. When the appraisal is performed the appraiser determines that the condition of the roof actually brings the value of the house down to $95,000. Now your lender will only commit to lending you $76,000 (based on that pesky 80% LTV).
There's a number of options you have at this point, but all basically equal to finding that extra $4,000 you now need to close. You can renegotiate the selling price (especially if your contract contained an appraisal contingency), you can ask the seller for a credit, you can ask the seller to fix it, or you can bring that extra $4K to the closing table.
So, the net answer to your question is: No, the roof doesn't have to "pass inspection", but the condition of the roof can effect the value of the home and if you did not take that sufficiently into consideration when negotiating the purchase price it can cause headaches.