The problem started a long time ago. Then the 90's and cheap fuel came along, such that profits weren't so good. When that happened, companies closed refineries in order to continue making a reasonable profit. Now environmental regulations are so tight on new refineries, it'd cost a fortune and would likely take years before a new refinery would likely pay for itself. Environmental assessment fees, design costs, permits to build, permits to start, herds of lawyers, etc.
So, let's consider the situation a bit more. Now there are two incentives for the oil companies to not build more refineries. 1) It would increase supply, which in this economy of supply and demand would lower prices, and lower prices aren't so good for profits. And 2) Government regulation and the sheer amount of money it would likely take to plan, design, and build a new refinery in the US. Afterall, pumps, distillation columns, and all the other associated equipment it takes to refine oil aren't exactly cheap.
When the old refineries we have are running near capacity, we have problems. Maintenance gets pushed to the back burner, stuff fails at a higher rate, and supply can be affected.
If you can scrounge up enough private funding to start up an oil company let me know, I'll help run it. It's not as if one can just go to a bank and take out a loan for that. Yes, can I get a loan for $100MM, I'd like to start an oil company. See how long it takes to get laughed out of the room.