You made a mistake. "ein Berliner" here is no direct object, it is an attribute.
The difference is that a state verb (bleiben, heißen, sein, werden, genannt werden, gerufen werden) introduces an attribute, while other verbs introduce the direct object. Since it is certain (because of the state verb) that the attribute refers to the same person/thing as the subject, it uses the same declination as the subject, which is the Nominative instead of the Accusative.
Ich bin ein Berliner. (attribute)
Ich sehe einen Berliner. (object)
An attribute can be a noun (der attributive Name), or an adjective (das attributive Adjektiv) :
Ich bin ein Berliner. (name)
Ich bin froh. (adjective)
An example of the use of the state verb (example with blieben) :
Ich bleibe ich.
Ich bleibe ein Berliner.
And examples using regular verbs that call for direct object:
Ich sehe mich.
Ich sehe einen Berliner.