The most common reason for this is being selected for additional security screening. The next most common reason (from my experience, at least,) is a problem with the ticket, though it sounds like that's not the case here.
There is a randomness factor involved in selection for secondary security screening. A certain percentage of passengers on many U.S.-bound flights will be selected, including U.S. citizens. (I'm a citizen and both myself and other U.S. citizens I've traveled with have had it when traveling back to the U.S.)
While there's always a chance of being selected randomly, there are some factors that increase the chance of being selected. One-way tickets and traveling alone (at least no one else on the same ticket) are a couple of common ones. Travel history is also taken into account, particularly to countries with governments that are less-than-friendly to the U.S. or those where terrorist groups are more likely to operate.
When you're selected for secondary screening, you will generally not be able to check-in online and, when you do get your boarding pass (at the airport,) it will have "SSSS" printed on it. For U.S.-bound flights, this often means that you will go through another security screening (typically somewhere near the departure gate) even after clearing the normal security, though sometimes the secondary check may occur in the same location as the normal security checkpoint.
Note that, contrary to what another answer suggests, this generally has nothing to do with concerns about whether you're allowed to enter your destination country. That will ALWAYS be checked by the airline when boarding an international flight, from any country to any country (aside from special cases like the Schengen Area, where a flight is technically 'international,' but no immigration controls are involved.) Selection for secondary security screening is done by government security services, who communicate that decision to the airlines. The decision is not made by the airlines themselves.
In cases like this where you can't check in online, I do strongly recommend planning to arrive at the airport earlier than you had originally planned in order to allowed extra time for the secondary screening.
If you suspect that there may actually be something wrong with your ticket, though (as opposed to secondary screening selection,) then I would recommend calling the airline as soon as practical. Ideally, do not wait until you get to the airport in this case. In my experience, the most common issues here are things like flight changes, where the airline may have changed you to a different flight, but the reticketing process failed for some reason. In this case, you need to have an agent reissue your ticket, which is definitely preferable to do before arriving at the airport. I've had this happen a few times, both after flight changes by the airline and when applying upgrade certificates. Ticket wasn't properly reissued for some reason, so, when I attempted to check in, while my reservation was still valid, I had no ticket. This was usually cleared up pretty quickly by the phone agents, after which point I could check in online.