High court sides with Catholic agency in foster care dispute