Juan es filosofo
Juan es un filosofo.
In the first, John is a philosopher by profession; we are just identifying him as a member of a class by giving him that label.
In the second, he is just being philosophical; this is not a standard label for John but is something exceptional.
Compare: Juan es atleta / Juan es un atleta importante
In the first, he is a professional athlete but in the second, while athletes are a class, “important athlete” individualizes John.
Especially with words like tener, haber, buscar, sin, con, etc., where the question is merely about the existence or nonexistence, occurrence or nonoccurrence of something, no indefinite article is used. Thus:
Tengo fiebre, busco casa, hay medico aqui, sali sin corbata……. but:
Tengo un hambre feroz, aqui tengo un paquete con ropa, ayer hubo una reunion grande… where in the last line the items are individualized somehow, then the indefinite article is used.
After the verb ser, Spanish does not use the indefinite article when the purpose is merely to identify a person or thing by attaching some conventional label. It does use the article when the purpose is not merely to identify but to make the person or thing stand out. A noun used as a figure of speech (e.g. she is an angel or he is a pirate meaning he is a sharp businessman) therefore calls for the article, as do most combinations wherer there is an enhancing adjective such as great, wonderful, despicable, etc.
Similarly, the indefinite article is not used in Sp when a noun in object position is considered merely in the light of its existence or nonexistence. The verbs whose meaning refers fundamentally to existence, tener and haber, and the prepositions that refer to presence or absence, con and sin, are the commonest situations where the article is not used. But if the purpose is to focus on something already considered to be in exisence (one of those) and to make it stand out, the indefinite article is used.
English has this identical contrast in the plural, though not in the singular. Thus if we say We have examinations we mean merely that examinations take place (where we are concerned) – we refer to the existence or occurrence of the examinations. But if we say We have some examinations, the attention is immediately drawn to particular examinations. Likewise, though in the singular we require ’a’ in John is a lawyer, nothing similar is required in the plural: John and Henry are lawyers.
IMHO, these article features of the language are a prime example of features people learn to use more or less correctly without learning any rules overtly and if they do learn the rules, they cannot apply them in ordinary discourse.