I've tried reading Wikipiedia and other sites and i just can't seem to understand what they actually do and why they even banded together in the first place.
Were they a secret organisation? What work did they do? did they have a philosophy?
If someone can explain that would be nice.
On a very basic level, the freemasons originated from the stonemasons guilds. Originally they existed in a function similar to other craftsmens guilds, regulating the practices of their respective crafts. At the beginning of the 18th century the masonic lodges began inviting non-masons among their ranks and the organization grew to become something more akin to gentleman's clubs where various freethinkers, dissenters and gentlemen of means could meet, fraternise and voice ideas. The freemasons teach lessons on enlightenment, self-improvement and equality. Eventually the lodges in Scotland (at least according to a significant number of scholars on the topic) began organizing what is considered the first "modern lodges" which were centered around the rituals rather than the traditions of the guild. These lodges spread and eventually the London lodges united to form the first United Grand Lodge of England in 1717.
The lessons as such are a bit, well, special. Symbolism is heavily featured and centered around masonic tools and symbols. To each tool or symbol there is a lesson attached which is taught through articles, lectures by senior members or private lessons. As you progress up the ranks you are gradually taught more lessons as well as symbols, grips, tokens and signs that can be used to identify yourself to other masons. The process is roughly a three step journey. Initiation, meaning you start learning the new lessons. Passing which is demonstrating your familiarity with the things you've been taught and finally raising which is an official recognition of your new rank.
> Were they a secret organisation?
That depends. Membership registers are generally not open to the public but, with the exception of times where active persecution of freemasons have existed, members are not required to be secretive about their membership. For example the senior members of various lodges are usually public information. Here are the senior members of the United Grand Lodge of Enland for example. The use of publicly regonizable symbols is also fairly common, the masonic square and compasses is probably the most well known symbol often worn publicly on pins or rings. This does however vary between rites (basically subdivisions within the masonic order) and over time.
> What work did they do?
"They" as an organization do not have a grand agenda. Masonic lodges may pursue their own goals set by motions and votes by their members but these are generally charitable undertakings of some sort. If you want to find out what a specific lodge does, the information is usually on their respective websites.
> Did they have a philosophy?
Not an overarching philosophy as such no but they do have rules which you must adhere to which, I suppose, could be summarized and expressed as a philosophy. Exactly which varies between rites but frequently the include things such as belief in a supreme being, lawfulness, moderation, self-improvement and an overall dedication to the improvement of society. Contrary to popular belief, preferential treatment of fellow masons (nepotism), shadowy political agendas and the like are prohibited, in fact, even discussing politics and religion is banned in many lodges and may constitute grounds for exclusion. The entire constitutions of the UGLE is available online here but keep in mind that these rules are specific to the UGLE, not freemasonry as a whole.
If you want a pretty comprehensive rundown of masonic history you could try to get your hands on The Origins of Freemasonry: Scotland's Century, by David Stevenson or, if you want a summary of the current scholary debate about Freemasonry, try Steven C. Bullock's Initiating the Enlightenment? Recent Scholarship on European Freemasonry.