factors on credit-deterioration used to calculate the ACLL primarily related to the COVID-19 pandemic as compared to the same time last year. For the three months ended June 30, 2022, the provision for credit losses on unfunded commitments was $294,000, compared to $257,000 for the three months ended June 30, 2021. The increase was attributable to a change in methodology as a result of the adoption of CECL, as well as increases in total unfunded commitments during the quarter. During the three months ended June 30, 2022, net loan charge-offs totaled $16,000, compared to $141,000 during the three months ended June 30, 2021. The decrease in net charge-offs was primarily due to decreases in the following loan categories: $98,000 in other loans (which includes deposit net charge-offs of $77,000), and $28,000 in indirect home improvement loans. A further decline in national and local economic conditions, as a result of the COVID-19 pandemic or other factors, could result in a material increase in the allowance for credit losses and may adversely affect the Company’s financial condition and result of operations.
Noninterest Income. Noninterest income decreased $3.8 million, to $4.4 million for the three months ended June 30, 2022, from $8.2 million for the three months ended June 30, 2021. The decrease during the period primarily reflects a $4.3 million, or 67.7% decrease in gain on sale of loans due primarily to a reduction in origination and sales volume of loans held for sale and a reduction in gross margins of sold loans, partially offset by a $574,000 increase in service charges and fee income as a result of less MSR amortization reflecting increased market interest rates and increased servicing fees from non-portfolio serviced loans. Gross margins on home loan sales decreased to 3.10% for the three months ended June 30, 2022, from 3.82% for the three months ended June 30, 2021.
Noninterest Expense. Noninterest expense was unchanged at $18.9 million for both the three months ended June 30, 2022 and the three months ended June 30, 2021. Decreases in salaries and benefits of $196,000 and in operations of $344,000 were mostly offset by increases in data processing of $252,000, loan costs of $104,000, marketing and advertising of $89,000, and FDIC insurance of $62,000.
The efficiency ratio, which is noninterest expense as a percentage of net interest income and noninterest income, rose to 65.08% for the three months ended June 30, 2022, compared to 64.33% for the three months ended June 30, 2021, primarily representing the decrease in noninterest income.
Provision for Income Tax. For the three months ended June 30, 2022, the Company recorded a provision for income tax expense of $1.6 million as compared to $1.9 million for the three months ended June 30, 2021. The decrease in the tax provision is primarily due to a $2.2 million decrease in pre-tax income during the three months ended June 30, 2022, as compared to the same quarter last year. The effective corporate income tax rates for the three months ended June 30, 2022 and 2021 were 19.1% and 18.1%, respectively. The increase in the effective corporate income tax rate was primarily due to reduced excess tax benefits of $22,000 on option exercises in the three months ended June 30, 2022, compared to $360,000 excess tax benefits for the three months ended June 30, 2021.
Comparison of Results of Operations for the Six Months Ended June 30, 2022 and 2021
General. Net income was $13.6 million for the six months ended June 30, 2022, and $20.4 million for the six months ended June 30, 2021. The decrease in net income for the six months ended June 30, 2022 was primarily impacted by an $11.0 million, or 51.8% decrease in noninterest income, a $2.7 million increase in noninterest expense, and a $1.4 million increase in the provision for credit losses, partially offset by a $6.1 million increase in net interest income.
Average Balances, Interest and Average Yields/Cost
The following table sets forth for the periods indicated, information regarding average balances of assets and liabilities, as well as the total dollar amounts of interest income from average interest-earning assets and interest expense on average interest-bearing liabilities, resultant yields, interest rate spread, net interest margin (otherwise known as net yield on interest-earning assets), and the ratio of average interest-earning assets to average interest-bearing liabilities. Also presented is the weighted average yield on interest-earning assets, rates paid on interest-bearing liabilities and the resultant spread at for the periods presented. Income and all average balances are monthly average balances. Nonaccruing loans