usually a spark plug
coming loose is because it was not tightened up correctly.
making sure the plug is not cross threaded and screwed all the way in and torqued to the correct ft/lb.
2.3L= 9 ft/lb
make sure the plug threads and the threads in the head are clean before installing