This work presents a model of credit rationing under the effects of judiciary in- efficiency and criminal extraction. Under low judiciary quality and high criminality, we argue that banks are more likely to lend to the government rather than private enterprises. We argue that credit rationing increased local public debt in Mexico before coming into effect the new law of Financial Discipline for States and Municipalities in 2016. Our scientific objective is explaining the supply of bank loans to the local public sector in Mexico under low institutional quality and credit rationing. We use Panel regression analysis and also applied an Autoregresive Distributed Lag model to obtain the long term growth rates. We also used Clustering analysis in order to classify states in Mexico in terms of their debt, defaults in the industry sector, crime and judicial inefficiency rates. Our empirical analysis shows that judiciary inefficiency and criminality induced higher amounts of bank loans to state governments during the period of 2004 to 2016. We also found that defaults in the industry sector also increased the amount of bank loans to local governments in Mexico, which may explain in part that the rationed credit is redirected to the public sector. We argue that keeping the quality of institutions low may induce higher bank lending to states, so there might be little incentive to improve the judiciary and public safety. The possible solution is to improve judicial efficiency and decrease criminality in order to reduce credit rationing and subsequently ensure local public debt stability in the long term.