If you wanted to do as you started with, then you need to tell Mathematica to evaluate `expr` in the RHS, like this

expr = x /. First@Solve[y == a x + b, x];

func[y_, a_, b_] := Evaluate@expr;

func[1, 1, 1]

(* 0 *)

Another option is to use transformation Rules, like this

expr = x /. First@Solve[y == a x + b, x];

expr /. {y -> 1, a -> 1, b -> 1}

(* 0 *)

and if you really still want to use a function, you can use transformation rules with that as well. The good thing about using rules is that you do not have to worry about mixing the order of parameters, and it is more clear when reading the code which is a,b and y

Clear[a, b, y, x]

expr = x /. First@Solve[y == a x + b, x];

func[parm_List] := expr /. parm;

func[{a -> 1, b -> 1, y -> 1}]

(* 0 *)

func[{b -> 1, a -> 1, y -> 1}]

(* 0 *)

func[{b -> 1, y -> 1, a -> 1}]

(* 0 *)