When I select and deselect some file on my desktop, an orange line appears near the file name. Why does this happen?
As part of the way that an entry is highlighted, the name is surrounded by an orange bar as an additional visual indication of which item has been selected, and to draw attention to the name of the selected item, which may help differentiate from other similar items.
You may notice this same behaviour for files shown anywhere in nautilus: the name is surrounded by a rounded rectangle (this is more clearly defined as the shape for items with very long names, preferably containing spaces, which wrap).
This behaviour may be changed by selecting an alternate theme in the Appearance control panel. Note that alternate themes may well also highlight the name of the icon, but perhaps in a different way, or in a different colour.
On the other hand, if I've misinterpreted your question, and you have a thin orange line appearing near anything you select, and staying there for a while when you select something else, you've probably found a display update bug of some sort: please report it as a bug against nautilus (nautilus may not ultimately be at fault, but it is essential to replication, and will help to find the actual bug).