Are the coins scattered around the castle only useful for health?

Solution 1:

In answer to the title, yes. In answer to the body, no :P

There's nothing special about those coins. They won't trigger lives, secret passageways, or anything else. As I noted on another answer before it was removed, there aren't 100 coins in/around the castle so you can't get a star from them either.