It was from the 90s. I don't remember the title but it was about a group of soldiers/army passing through an unknown place like a desert. At the end of the movie the protagonist is kidnapped by the orbs and then wakes up at the hospital. That's all I remember.
That sounds oddly close to two Star Trek episodes that aired in September/October 1998:
In DS9 7x01 (Image in the Sand) and DS9 7x02 (Shadows and Symbols), Sisko learns of the Orb of the Emissary and that he must find it to restore contact with the Prophets. While digging through the sand in a desert on the planet Tyree, the Prophets' enemies (the Pah-Wraiths), send Sisko visions of being in a mental institution:
The description is a little vague, but it shares elements with both the 1995 sci-fi/horror movie "Screamers" and its sequel "Screamers: The Hunting". In both films, a group of soldiers must travel through the desert while being hunted by Screamers, which are artificial life-forms that vaguely resemble mechanical eels or lizards. The screamers travel through the sand and launch outwards towards their victim. In some scenes they do appear almost sphere-like.
At the end, the survivor is nearly captured but ultimately escapes in a shuttlecraft. In one scene, the survivor appears to have been killed but wakes up in a facility safe & sound (having been rescued) - that may be what you're thinking of, although it wasn't a hospital.
Both films are fairly dark & gritty, with plenty of SAW-like gore. The overall tone is very similar to Aliens 3, albeit with a lot more daylight action (and less indoors). The majority of both films takes place outside in the desert and sandy/rocky areas of the planet.
Here's the Wikipedia link & trailer:
What you describe may have been a re-airing of an episode (or episodes) of The Prisoner (1967).
The story features former secret agents, soldiers, and others trapped in a village for unknown reasons, and any attempts to escape across the countryside are often foiled by a "Rover", a mysterious, floating balloon-like creature which knocks the characters unconscious and collects them; often returning them to the village hospital or their beds.
According to Wikipedia, there was a remake released in 2009. http://en.wikipedia.org/wiki/The_Prisoner
I think it's The Objective.
In Ghazni Province, Afghanistan, a Special Forces team meets CIA Agent Benjamin Keynes, who indicates that their mission is to find a very important Afghan cleric by the name of Mohammed Aban. The team leader, Wally Hamer, briefs the men to be ready. After being inserted, the team finds a local guide, Abdul, in a village in Southern Afghanistan, where Aban is from. Together, they go to the mountains, where the cleric has a reputation for hiding.
As they go further into the mountains, they begin to have strange encounters. First, they are ambushed by gunmen who kill Trinoski. The team returns fire, killing multiple gunmen, but when they check the bodies, they have disappeared. That night, the team spots headlights of a vehicle approaching. However, the two lights separate and then speedily fly into the sky and disappear. After speculating on what the lights may have been, they radio for a helicopter to resupply them.
Running out of ammunition, water and food the team wanders further into the desert where they finally encounter the vimanas at what appears to be the location that the British regiment was destroyed. Sadler, overwhelmed with fear, opens fire upon the seemingly invisible vimanas only to be vaporized. Keynes flees with Degetau and abandons him later, as he is too sick to continue, and later hears his screams before being obliterated by the objects. Exhausted and traumatized, Keynes searches for water. He encounters an oasis and drinks water from it only to discover the body of Hamer laying next to the water. Unable to grasp the horror, he passes out. When he wakes up in the night, he hears the distant sound of a helicopter and fires his flare gun. Simultaneously, several flares fire up from the valley. The bright light he encountered earlier re-appears and two beings from it approach him. As it touches his forehead, he sees visions and hallucinations of various objects and landscapes from his previous encounters, causing him to go into a trance. In the final scene he is shown floating several inches above a bed with a talisman he took from Aban's home in his hand, inside a hospital room, where doctors and a military colonel are observing him through a glass window. In a trance, he finally whispers, "It will save us all..."
The trailer has some clips with the orbs: