Use double quotes to have the var evaluated properly:
$ var=43
$ sed "s/.*had a little lamb.*/Mary had $var little lambs/" file
Mary had 43 little lambs
with fleece as white as
snow. Everywhere that
Mary went, the lamb was
sure to go.
See Jacob Minshall's answerJacob Minshall's answer regarding the .* instead of *.. I had written the sed command from scratch, so I did not notice the error in the original code.