In-game, black walls serve to keep puzzles from being too simple by restricting where the player can place portals. However, I'm curious to know if a more in-universe reason is ever given for why these black walls reject portals?
These white walls are actually painted with a substance called "Conversion Gel" which allows portals to be opened in them.
Several areas in the Condemned Testing Facility seem to indicate that the Conversion Gel is used to paint all further testing facilities, explaining how only white, painted walls were affected by the Portal Gun.
Conversion Gel is made from a particular type of rock mixed into paint and applied to surfaces. This explains why:
You can shoot a portal into space at the end of Portal 2 - conversion gel is made from moon rocks, and you hit the moon with the portal exit.
In Portal 2 we learn that certain surfaces are much better suitable to "host" portals, besides the limitation that it needs to be flat.
Moon stone is actually the best material for portals which Cave Johnson could find and buy. Though, it is never stated why it is so suitable for that task...only that grinding it into powder is a very bad idea... This also leads in Portal 2 to the Conversion Gel which allows you to place portals on any surface as long as it is covered in conversion gel.
Therefore it seems logical to assume that there are materials which "repel" portals and can not hold them.