Most likely you should reset the relative transform (ie. set trans/rot to 0) when you attach an object to another. This will snap it to the other object because otherwise if you keep the relative transform of the object, it will move away since it is inheriting a parent transform.