There are actually quite a lot of variables in making decisions between bonds, and rather than delve into the myriad details; I'm just going to approach your question looking exclusively at why someone would buy bonds when they're comparable to US Treasury yields.
First, it depends on what you are looking to buy. According to TreasuryDirect.gov (read: the US Treasury) "You may purchase up to $10,000 each of electronic EE and I Savings Bonds, per person (individual or entity), each calendar year. Purchases of any other Treasury securities do not alter the purchase limits for electronic EE and I Savings Bonds."
So if you're looking for some yield, and have hit your limit; you're only alternative is to go into the private market.
Additionally, if you were looking outside of the Saving Bonds; then you hit another limit. "The limit for noncompetitive purchases is $10 million for each security type and term, for each auction. This limit applies regardless of whether you're buying a bill, note, bond, Floating Rate Note, or TIPS, and regardless of what method you use to make the purchase..."
Given the Bond market is vastly larger than the Equity market, you have far more money and participants sloshing about within this market; creating a vibrant secondary market that will have a material impact on the actual yield (not the coupon rate, and this of course assumes no manipulate in the bond market by the Federal Reserve). Since there are material limits to how much can be owned, it means to meet yield-needs; buyers have no other recourse but to go to other products.
Finally, there are some advantages to other products. For example, Municipal bonds can (depends on the offering) offer tax incentives. While Treasury bonds provide State Income tax exemptions on the income from the bonds, municipal bonds can extend that federal income tax exemption to also include State Income tax exemption.