BOSTON – The Massachusetts Supreme Judicial Court (SJC) has upheld steep rate increases by the state’s home insurer of last resort, turning aside a challenge by the attorney general.Thursday’s ruling is a setback for homeowners in coastal areas including Cape Cod, where fears of hurricane damage have led insurance companies to pull out of the region.The high court considered Attorney General Martha Coakley’s challenge of a 2006 rate decision by former Insurance Commissioner Julianne Bowler. Bowler approved a rate proposal by an industry consortium that provides coverage when individual insurers aren’t willing to take the risk.The rates increased Cape Cod homeowners’ premiums by 25 percent. The increase was 20 percent in New Bedford and parts of Plymouth and Bristol counties and 12.4 percent on average statewide.Insurance companies in some instances have stopped writing policies for coastal dwellers. The companies have asserted that the rising cost of re-insurance – the amount insurance companies pay to insure the policies they have written – is the culprit driving the market.The SJC ruling essentially impacts all those who live at low elevations near the sea, where computer models studied by insurance companies indicate they will most likely become victims of storms and tidal surges. This includes North Shore communities like Swampscott, Marblehead and Nahant.Homeowners abandoned by their insurance companies can seek assistance from the Mass Fair Plan, which offers insurance for risky customers at a significantly higher premium.Some insurance agents, like John L. Hughes Jr. in Swampscott, fear the Fair Plan will become inundated by customers with nowhere else to turn for home insurance.As he put it, “How long can the state maintain its place in the market? Right now, the Cape has nobody to insure them. It’s all Fair Plan down there. And you are going to flood the Fair Plan if you keep going in that direction.”Some state lawmakers believe a solution can be found in legislation that that makes insurance companies contribute money to a pool, just as hospitals do in order to pay the medical bills of indigent or poorer patients. Others say the situation reflects red-lining by insurance companies who prefer to issue policies only to low-risk customers who live far from the sea.