Why does gravity not repel things or like charges attract?
Gravity is one of the 4 fundamental forces of nature, and the first to be discovered (the other three are the electromagnetic force, which is responsible via chemical bonds between the atoms for most of what we call "force", such as friction, or the force you feel when you put your hand against the wall, etc; the weak force, which is responsible for nuclear beta decay (radioactivity), and the strong force, which holds the nucleons in the kernel of atoms together).
However, gravitational force is different than the other three forces, by exactly this property - it only attracts. As a result, our modern view of gravity - which is based on Albert Einstein's theory of general relativity, is very different than our view of any of the other forces. According to general relativity, gravity, in fact, is not a force at all! This is very different than the "classical" mechanics (constructed by Isaac Newton), in which gravity is a force.
According to general relativity, gravity is in fact curvature of space (time). Without gravity, space (more precisely, space - time) is flat, similar to a flat piece of paper (but in 4 dimensions). However, the existence of mass, namely gravity, "bends" space (time), which is no longer flat. When bodies move in this curved space (time), they move in straight lines - only the space in which they move in is curved. As a result, their trajectories look as if they are accelerated due to gravitational force. One way of visualizing a motion on straight lines on curved spaces is to think about airplanes flying between different continents. The earth is curved (it is a sphere), and so, when an airplane flies from, say Europe to north America, it always look as though its path is bent towards the north; though, in fact, the airplane always fly in the shortest possible path, which is a straight line (to save fuel, of course).
Indeed, so far physicists were able to merge the other three forces (electromagnetic, weak and strong), within the framework of quantum field theory (QFT), which formulates the theoretical basis of the "standard model" of particle physics. Constant attempts are made to try to unify gravity into the QFT framework, which is the best theoretical model known. Within the framework of QFT, forces are mediated via interaction of elementary particles. (There is no such thing as "acting from a distance"; a particle must be involved in each interaction, which ensures, e.g., that nothing travels faster than light). All the particles that transmit the strong, weak and electromagnetic forces have various types of charge, such as electric or colour charge. Those charges can be either positive or negative, leading to different possibilities for the sign of the force. In order to incorporate gravity into the theory, the existence of a hypothetical particle, called the "graviton" was proposed (the name is attributed to Dmitrii Blokhintsev and F. M. Gal'perin). Gravitons, however, are different than the particles that transmit the other forces, as they respond to energy density, which is always positive. As a result, gravity is always attractive. It should be emphasised, though, that so far no gravitons were ever detected, and therefore although there are theoretical predictions to many of their properties, their existence is currently only a hypothesis. If this idea is correct, then general relativity is obtained as a classical limit, in the very same way as Newtonian gravity is obtained as a classical (weak field) limit of general relativity.