As he said a castle is mostly a place to station your troops until they are needed.
If you want money you best take a town with many villages while independent (best cities have 5 villages) and then join a kingdom.
Be warned though that the number of soldiers you have to bring into a war is based on your fief size. With 1 city, 2 castles and 6 villages I had to bring 54 men last time - and my maximum was 55

with leadership 2. I usually gather an elite troop (infantry and/or archers) for the first attack and take the castle nearest to the city I plan to take later. Then I replace fallen elites (for the next attack) and garrison lots of low level troops in the castle (as deterrent against attack). When I think I'm ready I take the city or perhaps other near castles to create my own little barony.
If you plan to join a kingdom after that you should take your castles/cites from their enemies so that they help in the defense later.