The buildings of the Buda Castle are currently occupied by 2 museums (the National Gallery and the Budapest History Museum) and the National Library. All of these attractions can be visited, but there is an entry fee. There is no area in the Castle building, which is ‘castle only’, as all rooms, halls etc. are the home of these 3 institutes.
Basically, inside the wings / buildings of the Castle itself there is no place with free entry, unless you have purchased a Budapest Card for the group.
Buda Castle (the Royal Palace) was robbed clean in WW2, it was also bombed, then restored. The building was empty, and these days the city keeps the castle in an excellent condition by generating revenue from tourism, that is the reason why there is no free entry inside (similarly to other attractions in Europe).
The outdoor courts of the Castle, with the statues, fountains, etc. are free to visit of course (outside, but within the big metal gates of the Buda Castle building area).
Also, the picturesque hilltop neighbourhood of the Buda Castle is great to visit, with lots of further attractions and lovely houses, living history.