I would say embedding the sensor in the wall as much as possible. At the very least, after attaching the sensor to the wall, cover it up with some insulation.
However, the situation may be a bit more complicated. Walls are usually made of material with low thermal conductivity, so a significant thermal gradient may exist across the wall. If you are really concerned about the wall surface temperature, an optical remote sensor, pointed at the wall and properly calibrated for its emissivity may be the most accurate solution.
If it is about a permanent installation: attaching the temperature sensor to a piece of metal sheet (for improved thermal coupling) and attaching it to the wall surface should do. If the buildup on top annoys, you will have to make a shallow groove to let the sensor and the wires "vanish".
If it is about a temporary setup: use an IR thermometer. Adjusting the thermal emission coefficient is quite easy: spray-painting with (matte) black varnish has a good match to the 0.95 standard emission coefficient most IR thermometers got implemented.
As Boris L. Glebov already stated: calibrating the emission coefficient of your IR thermometer is an option. If the instrument supports this calibration.
The good thing about a proper IR measurement is that you can sample various places on the surface of the wall. Corners, windows, other materials in contact with the wall may set up temperature gradients across the surface.
If you are going to have only 1 physical sensor in contact with the wall then some sort of grease, as you suggested, is advisable. Or some good large area conductor such as described by Dreher. A sensor on the wall can also be influenced by radiant source in direct line of sight to the sensor so covering it would be advisable as suggest by others.
Using or installing sensors or "embedding" into the wall at different points is a good idea.
If you are carrying our experimental research work, I would rather suggest you to use Thermal Imaging Cameras as an accurate tool to get the "WHOLE PICTURE" of the wall. This will help you get more information about not only the temperature gradients but also the thermal couplings and heat flows and thus the entire distribution of the thermal profile of the wall (under consideration).
I hope this idea suits you more to your requirements.
If we exclude the infrared camera, we can obtain good result by use of a thermocouple.
In the case of a concrete wall, we insert the half of the thermocouple (the half of diameter) in a groove in the wall and we fill around with silicon grease and cover this region of thermocouple with a thin aluminum film to avoid direct radiation.
Ok :-) I like a lot of temperature measurements. All over the equipment or system. Temperature measures the energy state of a system. It's the bottom line. You don't exactly know what's happening but if the temp changes, then the system has changed it's energy due to leaks, fires, reacting to stimulus etc etc. then you can look harder to find out what happened.
I use thermistors. Standard 10k. They are inexpensive and easy to use. And vary about 4x an RTD. Thermocouples need the reference temperature. Thermistors don't. They can be as accurate as you want to pay for. But I use Thermistors for about +/-0.5C measurements. up to about 200C. Thermocouples for maybe 300C and up.
Ok, In the past when I was researcher student I used the first infrared camera (in 1982)
and also at that time I used a thermistor in the realisation of an electronic system which served as a surface reference temperature for this camera (1982)
but later I used the thermocouple in the surface measurement temperature particularly in situ
Non Invasively you can use cheap IR modules such as MLX90615 but if you want to do it invasively I recommend Dallas 1-wire digital temperature sensors DS18B20 you can use multiple of them on the same bust and using them is very easy and well documented.
The IR imaging would be the better solution. The kind of sensor to be used depend on your requirement of resolution and accuracy. choice also depend on the kind of application whether it is indoor of outdoor. For outdoor wall, IR may be the choice but may provide little variation if you are keenly interested in small changes. In such case I would recommend the semiconductor or thermistor type to be used at different places as already suggested by others and an average may be preferred. But care must be taken to keep the wall temp and sensor at the same temperature. sometimes sensor (metallic one) may heat up due to external radiation which depend on its heat capacity and may indicate higher value even if the wall may remain at lower.
IR imaging seems most reasonable for initial measurements, but be careful in properly setting the emissivity factor. With IR you will cover a wide measurement area with good resolution and you can achieve satisfactory accuracy.
Then, if you need more precise measurements think about putting temperature sensors.
That would probably depend on your ultimate goal or purpose.
Though, if you put a sensor directly on the wall, you need to think about the radiation heat transfer to the sensor by the sun. So the measured temperature might be different from a sensor inside the wall.