In British English if one is in hospital because one is a patient, one uses hospital without any article- eg He was in hospital last week having a simple operation.
Yes, and "writing to you from the hospital" would imply a specific hospital (i.e. accusative)
No, the accusative is used to indicate the direct object of a transitive verb. In this sentence, although "the hospital" is definite, it is not acting as a direct object.
Here, "hastane" is acting as the object of the preposition. Although in some languages like German the object of the preposition does take accusative case endings, I do not believe Turkish is one of those languages.
My solution was "I am writing to you from a hospital", which was marked incorrect. Translating English definite and indefinite articles to/from Turkish is always a bit of a problem. However, Duolingo's translation states a definite hospital, which is not indicated in the original Turkish.
How do we differentiate?
If it were "Sana bir hastaneden yazıyorum", then your solution would be correct.
"seni" is the accusative case, which marks the direct object in a sentence; however, here there is no direct object--"you" is an indirect object. There is motion toward the indirect object, rather than acting directly on the direct object. "I am writing to you." Because of this, it has to be in the dative case, so it must be "sana."
"Hastaneden" - hospital. I cannot see hastaneden as "the hospital," just hospital. Hastane - den. Does "den" act as a determiner? Translation: I am writing to you from hospital. This is correct English grammar & sentence construction.