It depends. If the spaghetti is cooked but not overcooked there is a good chance it will stick to a porous surface like a cupboard or wood paneling. It may even stick to wallpaper or painted plaster. Increased chance if your spaghetti is cooked in the minimal water needed for the amount of pasta. You know how spaghetti sometimes sticks to itself in the pan? This is mostly due to starch, which makes your spaghetti stickier in general. If you have more water less starch will stick to each piece of spaghetti, so your spaghetti will be less sticky.
In short, various factors determine if your spaghetti will stick and therefore well it is completely possible to get spaghetti to stick to your wall, it is not a good measure of if your spaghetti is cooked.
In short, various factors determine if your spaghetti will stick and therefore well it is completely possible to get spaghetti to stick to your wall, it is not a good measure of if your spaghetti is cooked.