There are probably well over a hundred real castles converted to hotels in Europe - maintaining a castle is expensive, so most people who own one need to monetize it somehow.
Here's a German site that lists 40 castles and palaces converted into hotels in Germany alone...
The question is: how historical do you want it to be to count as "real"?
Older than 200 years?
Older than 500?
A pretty solid candidate would be Burg Wernberg in Bavaria: first documented in 1280, never substantially destroyed and rebuilt (which is the case for a great many old castles).
However, the historical past is not all that exciting (the castle seems to have changed hands a lot, but was never involved in big historical events).
travel.stackexchange.com/users/1371/Michael Borgwardt
For a medieval castle - a '10 story ominous looking castle' in Ireland, I remembered watching Alex Albrecht of Diggnation, talk about how he stayed in one (3 min in to video)
he found on Celtic Castles .
Note that Irish castles don't have moats.
Annoyingly he doesn't say which one, but certainly the website claims to be the biggest Castle booking website in the world, so I'd hazard a guess that it'd be a solid start :)
It includes bookings for castles in England, Ireland, Scotland, Wales and French Châteaux.
travel.stackexchange.com/users/101/Mark Mayo
There's a hostel called Albergue Juvenil Castillo de San Servando in Toledo (Spain) which is in a castle.
I have tried it
and it's the definitely the most beautiful hostel I've ever been to.
Check the website for additional information.
travel.stackexchange.com/users/1452/SylvainD
Sure, I don't imagine they're cheap though.
A quick Google threw up heaps of sites.
It's important to note that often stately homes or chateau are described as castles.
To me a castle has a moat and a bridge such as Leeds Castle (not actually in Leeds) staying in one of these might be a little more difficult.
Here are the first three links most of them are in UK though some are in France.
http://www.scottscastles.com/information/special-offers.html
http://www.castlerentals.net/
http://www.historic-uk.com/StayUK/RentaCastle.htm
Also there is the ruins of the castle in middle of lochleven which you could probably hide out in overnight without too much issue.
travel.stackexchange.com/users/449/Stuart
Carbisdale Castle in the north of Scotland is actually a youth hostel .
I stayed there for a few pounds back in the 1980s and it was a cool place.
It is currently closed for refurbishment until 2012, but dorm beds in Scottish hostels are around 20 pounds.
It is not a very old, it was only built in 1907, but it looks and feels like a much older building.
It has its own railway station very close by, admittedly it is a bit out of the way.
travel.stackexchange.com/users/1317/Peter Hahndorf
A castle?!
Pfwah!
For $70,000 you can have a whole European country for a night!
(Though it's not clear if you get to sleep in the castle )
travel.stackexchange.com/users/1383/Benjol
Another option is Oxford castle which was largely destroyed during the English Civil War, but what was left was made into a Gaol.
It remained a Prison until 1996 and was subsequently converted into a luxury boutique Hotel .
travel.stackexchange.com/users/1457/Mark Booth
I have a recollection of staying in the Grand Hotel in Brussels Belgium, that was a converted castle.
(But this was decades ago.)
Most western European countries feature castles with owners that need to defray the cost of their upkeep by providing "bed and breakfast" type services to visitors.
Check with local travel agents for prices and availability.
travel.stackexchange.com/users/788/Tom Au
There are quite a few castles in Germany where you can stay overnight.
As far as I know some castle owners rent out some of the many (converted) rooms in the castle just to cover the costs they have with maintaining such a building.
Here is a list from for hostels in a castle .
Sorry, not many pictures on this page, but you can still look up the castle name on flickr or google images.
travel.stackexchange.com/users/466/iHaveacomputer
Here is a french castle hotels website .
I looked around on this website, there is some Renaissance-era castles, but I didn't find any medieval-era castle at first glance.
BTW, in french, castle is translated as "château", if you want to search google or something.
travel.stackexchange.com/users/506/Thomas Radioyes
Yes it is possible.
Especially if you are in a group.
Before I had children I organized a annual board-game event in a castle with friends.
We were able to rent a castle for around 1000 Euro per weekend, which with around 30 people became quite affordable.
I cannot provide you with a link, because they don't have a website.
But I found them by asking while walking through the Ardennes in Belgium.
The location was also brilliant because of its name
"Ny" (Monthy python lovers will know what I mean)
If you are not in a large group, I also know Cortils Castle , which offers self catering accommodation.
If you would consider Cortils, I can recommend to arrive late on a moonless night.
It gives an erie touch to your arrival.
Other castles which offer accommodation are: Chateau de bonne esperance (Bed & Breakfast) Chateau de saint nicolas (French) Vaeshartelt Maastricht the Netherlands
travel.stackexchange.com/users/None/
I am not sure to understand what you call a castle (it was built in the middle ages?
It is fortified?).
However, there is a French chain of hotels called Relais & Châteaux that is a worldwide network of so-called "charming hotels" and in particular, castles.
I could not find a way to filter the results by the type of residence, but there are not that many (still about 200 residences in Europe and from a vague scan, I would say 50 are castles).
There is another chain of the same kind called Châteaux & Hôtels Collection but it seems to have fewer castles and mostly located in France.
travel.stackexchange.com/users/3044/Vince
Awhile back I've been to Italy and stayed at: Castello Di Carimate from that time
it only seem to have improved.
travel.stackexchange.com/users/1372/Karlson
I spent a night in a jail converted to a hotel in Switzerland, and it made me wonder if there is a real castle converted to an hotel in Europe.  And with "real" I mean the castle should have a historical past, and NOT a castle built recently or a hotel with a 'castle' look on the outside but on the inside it looks like a common hotel.  In short, I want to feel that I was brought back to the castle age if I stay in the hotel.
Is there any way to spend a night in a European castle?
travel.stackexchange.com
<europe><hotels><castles>
travel.stackexchange.com/questions/3960
travel.stackexchange.com/users/580/Rudy Gunawan
There are over a hundred such castles in Europe, often offering bed and breakfast-type services to defray the heavy cost of the castle's upkeep. Chateau de bonne esperance and Chateau de Saint Nicolas in France, Castle Vaeshartelt in Maastricht in the Netherlands,  Albergue Juvenil Castillo de San Servando  in Toledo, Spain, Burg Wernberg  in Bavaria, Germany, Carbisdale Castle  in the north of Scotland and Oxford Castle in England are possible options. Westen Europe appears to have a large number of castles that offer tourist accommodation. Notable examples can be found in Germany, France, the UK and Scotland.
Many countries in Europe have castles which offer accommodation for tourists. Castles in Bavaria, Toledo, Scotland and Oxford offer accommodation. 