Well, my first comment has to be "don't do it!"
First and most obvious, it's often hard work to dig a planting hole very close to a wall: not only do you keep banging your elbows while you are trying to dig, but walls should have foundations, which might well extend outwards quite some way. So when you try to dig, you find that you are hitting solid foundations.
Next, even if you have deep soil close to the wall, there is often a leaching effect from the concrete, mortar etc, which can adversely affect the way plants grow.
Also, you may well find the soil is mostly comprised of builders' rubble and other debris: at least this can simply be removed, but it might have a lasting effect on soil quality, if a lot of mortar and other chemicals have leached into the soil.
The soil very close to walls is often of very poor quality - partly due to the builders mentioned above, partly because, even if the builders did not leave a stack of rubble behind, they will have trampled over the area very thoroughly during the process of building, so there is probably a solid "pan" or crust, a little way below the surface: and partly because it will have been subject to rainshadow for as long as the wall has been there. So you will often need to bring in new, good quality soil.
Talking of rainshadow, anything you plant which is very close to a wall, will need a lot of watering attention: and not just at first, it will probably always need to be watered - partly due to the rainshadow issue, and partly because the presence of the wall will reduce it's "circle" of soil by 50%: the roots can only grow in one direction, instead of being able to quest out in 360degrees around the main stem.
For all these reasons, planting anything right slap up against a wall is a bad idea...
So what do you do, if you want to plant a - for example - climber, intending it to be trained up the wall? You have to plant it right at the base of the wall, don't you?
The trick is to plant it about 2' (60cm) out from the wall, and to lean the plant in, at an angle, so that the upper part of the plant is sloping back to the wall, and preferably is touching it, but the roots are a good distance away from the wall. You might need to add longer support canes, in order to guide the plant towards the wall.
This reduces the rainshadow effect, gives the plant's roots a chance to get at some halfway decent soil, and to experience a reasonable amount of rainfall.
Most climbers arrive from the garden centre in a pot with some canes already in it, which is handy - by planting the whole thing at an angle, you keep the stems of the plant straight.
It means having to digger a bigger-than-normal hole, because you have to get the entire rootball, slanted, under the ground: sometimes you can "cheat" a little, by brushing of some loose soil from the uppermost edge of the pot... but generally speaking, it's better to dig a bigger hole, so that the whole rootball can sit comfortably in it, at an angle.
This is a situation where a picture really is worth a thousand words! Annoyingly, I did this exact thing just last week, planting a Clematis montana against a wall, but I didn't take a photo. Sorry! I'll try to find a suitable plant, and will add a photo in due course.
In the meantime, I should say that there are a couple of good points about planting close to a wall, which I should mention: firstly, the heat from the wall reflects back onto the plant, creating a micro-climate which might be beneficial for the plant.
And secondly, some plants actually like having their roots crammed up against obstacles: Figs, for example, are often described as fruiting more freely, if their root run is restricted: and being planted up against a wall definitely restricts their roots, as described above!
So it's not necessarily a bad thing, to have to plant right up against a wall, but there are a couple of points which need to be taken into account, when you do so.