I was wondering that which of the following is better?
From Theorem XXX we obtain YYY is red color...
From Theorem XXX we obtain that YYY is red color...
Should I put "that" after obtain?
Both are grammatically correct. However, in this case, reading "From Theorem XXX we obtain YYY is red color" can be confusing at first. When first read, your brain might jump to "From Theorem XXX we obtain YYY" by itself. By including "that", it tells you that an entire clause is coming.
[I believe the use of colour as is in your sentence is actually wrong.]
So the question here is whether to remove the conjunction that or to retain it.
Here it is optional, and the writer/speaker has the liberty to either use it or omit it without affecting the meaning of the sentence.
Omission of the conjunction that is acceptable, not only in informal contexts, e.g.
They understood (that) this was an errand of mercy.
I would hate to feel (that) we were corrupting you.
But self-evidently it must be retained in some of the examples cited in the first paragraph above. When the conjunction that is part of the correlative pairs so ... that, such... that, now ... that (or so that, etc.), it is normally retained in formal writing but is sometimes omitted in informal contexts, e.g.
What would he do now (that) he had missed him in Toulouse?
The heat was up so high (that) almost everyone took off their coats.
That may not be omitted, however, if a phrase or clause intervenes between the verb and it, e.g.
I am saying, am I not, that I no longer loved Kioyok.
Reference - The New Fowler's Modern English Usage