The short answer is that if you are looking at a FICO score, then the Fair Isaac Company ("FICO") calculated it. When people talk about their credit scores, they are usually talking about the different versions of their score associated with each credit bureau. TransUnion, Equifax, and Experian all pay FICO to calculate the credit score based on the information on their different credit reports. Each credit report can have slightly different information on it, and each company weights things differently. The credit score is proprietary to FICO, and they keep the "formula" very confidential.
There are also other versions of credit scores (also done by FICO), like the Auto Enhanced score. There are also other credit scores done by other companies that are generally referred to as FAKO's around here. And sometimes banks use their own formulas to calculate risk and ability to pay.
I guess I don't really understand your question. Federal student loans (Stafford, subsidized and unsubsidized) are not credit based, so there's no credit check and the interest rates are set by the bank you take them out with, which is why it's worth shopping around. Private loans, on the other hand, are credit dependent and often require cosigners, and may use credit scores to impact your interest rates. But those loans have nothing to do with the government.
If you're talking about something else, FHA loans, for instance, then the reason that your credit score is used in setting your interest rate is because the bank holding your mortgage must still assess your risk and ability to pay them back. The government only insures the transaction, and is not actually a part of the purchase. It's really only a "government loan" in terms of the bank--your relationship is just with the bank.