Traditional individual retirement accounts and Roth IRAs offer investors a tax shield. But they are specialized accounts that follow a unique set of rules; break those rules and you could run afoul of Uncle Sam, and ruin the benefits of some specialized investment options.

For example, I'd never put high-yield midstream energy giant Enterprise Products Partners L.P. (EPD 1.41%) in an IRA. Here's why -- along with a similar high-yield stock that you might consider buying instead.

The rules

IRAs seem much simpler than they really are. In exchange for the ability to defer current taxes (in the case of a traditional IRA) or future taxes (in the case of a Roth) investors need to live by some rules. One of the more obscure ones that few seem to know about is a limit on unrelated business taxable income, something that limited partnerships have a habit of throwing off. If you earn too much of this type of income your IRA could be forced to pay income taxes. You read that correctly: Your IRA has to pay taxes, not you. If you don't like the sound of that, it's just not worth owning a limited partnership in an IRA of any type.

A man welding a pipeline

Image source: Getty Images

Then there's the not-so-minor issue that limited partnership distributions are often tax advantaged, with a portion of the payments coming in the form of return on capital. If you own a limited partnership in an IRA of either type you are pretty much wasting that tax advantage. Uncle Sam doesn't give out many tax breaks, so not taking advantage of one would be a shame.

I won't buy this LP, but...

These two reasons are why I would never put Enterprise into an IRA. Yes, it's a leading player in the midstream sector, often considered a bellwether for the industry. It has an incredible streak of annual distribution hikes (21 years and counting) and a fat 5.8% yield. And it is, by all accounts, a great partnership that is constantly looking for ways to get even better for its unitholders. But the drawbacks of putting it into an IRA means it isn't right for these accounts, no matter how high the yield is or how great a partnership it happens to be.

However, you could happily add ONEOK, Inc. (OKE 2.25%) without facing any of those issues, because this midstream company is structured as a regular corporation. Although ONEOK's yield of 4.8% is a little lower than Enterprise's, it shares a lot of the partnership's most desirable traits.

OKE Dividend Per Share (Quarterly) Chart

OKE Dividend Per Share (Quarterly) data by YCharts

For example, ONEOK has increased its dividend every year for 16 consecutive years. That's not quite as long as Enterprise, but still pretty impressive. Annualized dividend growth of 16% over the past 10 years, meanwhile, trounces Enteprise's roughly 5% historical annual distribution increases. So in this way it's an even better midstream company to own.

Looking forward, ONEOK is currently planning for annualized dividend growth of 9% to 11% between now and 2021 based on $4 billion plus in capital spending plans. So heady dividend growth is set to continue.

OKE Financial Debt to EBITDA (TTM) Chart

OKE Financial Debt to EBITDA (TTM) data by YCharts

And like Enterprise, its business is largely fee based. So it is a toll taker with key infrastructure assets that are backed by long-term contracts. It is, essentially, a stable business that can easily support a high yield.

Moreover, ONEOK has been focusing on improving its balance sheet, getting to the point where its leverage profile is roughly similar to that of Enterprise. So, for the most part, there's no added balance sheet risk here -- something that can't be said of Kinder Morgan Inc. (KMI 3.46%), which was forced to cut its dividend not too long ago because of its heavy use of leverage. While Kinder's dividend growth prospects are higher than ONEOK's right now, which might tempt you to buy it over either Enterprise or ONEOK, you have to couch the projected hikes in history to get a real feel for why ONEOK is a better option.

Finding good alternatives

Enterprise is a wonderful midstream partnership, but it just isn't a good fit for an IRA of any type. But don't skip the high yield midstream sector just because you are investing with an IRA, because high-yield ONEOK isn't a limited partnership, and it has a lot going for it.

First, it is a well run midstream company with a long history of rewarding investors well via large dividend hikes. Second, it has become increasingly conservative financially, so that it is, roughly, in the same ballpark balance sheet-wise as Enterprise, one of the most conservatively run midstream partnerships around. I'm confident that a deep dive into ONEOK will prove to you that it is a solid alternative to industry bellwether Enterprise.